From 390144351a8a03ca9d0dc832bf2c9bfac15263dd Mon Sep 17 00:00:00 2001 From: noisyfox Date: Sat, 17 Sep 2016 16:08:51 +1000 Subject: [PATCH] Fix #710 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. --- shadowsocks-csharp/Controller/Service/PortForwarder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shadowsocks-csharp/Controller/Service/PortForwarder.cs b/shadowsocks-csharp/Controller/Service/PortForwarder.cs index 54ecd49d..5245bb7e 100644 --- a/shadowsocks-csharp/Controller/Service/PortForwarder.cs +++ b/shadowsocks-csharp/Controller/Service/PortForwarder.cs @@ -46,7 +46,7 @@ namespace Shadowsocks.Controller this._local = socket; try { - EndPoint remoteEP = SocketUtil.GetEndPoint("localhost", targetPort); + EndPoint remoteEP = SocketUtil.GetEndPoint("127.0.0.1", targetPort); // Connect to the remote endpoint. _remote = new WrappedSocket();