Skip to content

Commit

Permalink
Stopped potential dns leakage
Browse files Browse the repository at this point in the history
  • Loading branch information
postworthy committed Jan 31, 2014
1 parent adec538 commit c06001b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions SocksWebProxy/Proxy/ProxyClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,16 @@ protected override void ProcessQuery(string Query)
}
try
{
IPEndPoint DestinationEndPoint = new IPEndPoint(Dns.Resolve(Host).AddressList[0], Port);
DestinationSocket = new ProxySocket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
// set the proxy settings

((ProxySocket)DestinationSocket).ProxyEndPoint = new IPEndPoint(Config.SocksAddress, Config.SocksPort);
((ProxySocket)DestinationSocket).ProxyUser = "username";
((ProxySocket)DestinationSocket).ProxyPass = "password";
((ProxySocket)DestinationSocket).ProxyType = Config.ProxyType;

if (HeaderFields.ContainsKey("Proxy-Connection") && HeaderFields["Proxy-Connection"].ToLower().Equals("keep-alive"))
((ProxySocket)DestinationSocket).SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, 1);
((ProxySocket)DestinationSocket).BeginConnect(DestinationEndPoint, new AsyncCallback(this.OnProxyConnected), DestinationSocket);
((ProxySocket)DestinationSocket).BeginConnect(Host, Port, new AsyncCallback(this.OnProxyConnected), DestinationSocket);
}
catch
{
Expand Down

0 comments on commit c06001b

Please sign in to comment.