开发者

Is it possible to use connection proxies using sockets?

开发者 https://www.devze.com 2022-12-24 20:52 出处:网络
I need to connect to a server from an environment with a SSL proxy on, is it possible to开发者_开发技巧 handle that environment using just sockets? Is it was a no-SSL proxy, would that be possible?

I need to connect to a server from an environment with a SSL proxy on, is it possible to开发者_开发技巧 handle that environment using just sockets? Is it was a no-SSL proxy, would that be possible?

Thank you very much.


If I understand correctly, you want to connect to a non-http tcp socket through a http/https proxy.

That is possible, you just connect to the http proxy, and send:

CONNECT hostname.com:portnumber HTTP/1.0

wait for a success response, and then you are connected to the external server and can send/receive data as normal.

However, many http proxies are configured to only allow you to connect to a limited number of ports, so if the server you want to connect to is not running on the standard https tcp port (443) your connection might be denied.

If the proxy does not allow https, it is unlikely to allow the CONNECT method. In that case your only choice would be to talk to a http server outside the proxy, which converts to/from the final protocol you want to speak.

It might be handy if you state exactly what protocols the proxy and server are using, as people could give more specific advice then.

0

精彩评论

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