> I was quickly able to implement the telnet part using a TWSocket > component. This works successfully through the Socks proxy and I > am very happy with it. A particular point to note is that DNS > resolution is done by the proxy machine, which is a requirement > of the project. > > For the http part I am looking at using a THttpCli component. I > am experimenting using the OverbyteIcsHttpGet demo, setting up > the Socks properties on HttpCli1. It works if I provide the > actual IP address of the remote server, but not when I enter a > url. It appears to use the local machine for the DNS lookup, not > the proxy. > > Is there some way I can encourage it to use the proxy for DNS > resolution? Alternatively, how can I get the remote IP address > from the existing TWSocket connection? (PeerAddr only gives me > the IP of the proxy server).
Don't know much about Socks proxies, not used one for many years. But a quick look at Wikipedia suggests SOCKS4a and SOCKS5 allow a domain name to be passed in the protocol setup rather than an IP address which is how sockets are normally opened. Normally ICS components do a DNS lookup first, then use that IP to open a socket. For SOCKS, the lookup would need to be skipped, and it's possible WSocket is doing that, but the HTTP client is not, which would explain your experience. This might have worked in the distant past, but got broken as other improvements were made, and no-one noticed because SOCKS use is rare. But I've not looked at any source code and will not be able to test any of this for a couple of weeks. Maybe someone else is actually using SOCKS with ICS? Angus -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be