When using http proxy, this will cause distinct latency
if we are trying to resolve localhost.
Currently it's unnecessary to do that because our privoxy
doesn't listern on ipv6 address, so it's ok to hard code
the ipv4 address.
There is a plan to add a cache to record the ipv6 connectivity
so that we needn't to try both ipv4 and ipv6 every time when we
attempt to connect a DnsEndPoint.
Socket.ConnectAsync will create socket and handle the address family
itself. This solves some compatibility issues on win7.
Signed-off-by: noisyfox <timemanager.rick@gmail.com>
-Use dual-mode socket & DnsEndPoint to handle all domain name connection.
-Move all socket creation into one single function.
So that we could treat domain name just like ipv4 & ipv6 address.
This also solves the async domain solving problem because the os will
hanlde it for us.