开发者

Dns caching for sockets

开发者 https://www.devze.com 2023-01-01 19:30 出处:网络
I\'m connecting to some websites through socks proxy server. In my case its very good to implement dns cache, so proxy don\'t need开发者_JAVA技巧 to resolve website\'s ip address. So, I performed DNS

I'm connecting to some websites through socks proxy server. In my case its very good to implement dns cache, so proxy don't need开发者_JAVA技巧 to resolve website's ip address. So, I performed DNS lookup, but don't know where to supply IP address. mySocket.Connect uses proxy's ip address so it isn't right place. I tried to place it in http header GET http://11.22.33.44/index.html HTTP/1.1 - this doesn't work (even in browser) since website is on virtual hosting. It seems that Host header is right place for resolved ip address. Am I right? Will proxy resolve host name (since it's still there in GET header) or not?


What you need to do is connect to the SOCKS host. You then instruct the SOCKS host to connect to the IP address that you have cached from DNS. When you are connected you send the HTTP headers (GET request and HOST header) that specify the original domain name.

0

精彩评论

暂无评论...
验证码 换一张
取 消