zaphoyd / websocketpp

C++ websocket client/server library
http://www.zaphoyd.com/websocketpp
Other
6.98k stars 1.97k forks source link

Provide SOCKS proxy support #505

Open GamePad64 opened 8 years ago

GamePad64 commented 8 years ago

Hi! I am writing a peer-2-peer application, that uses WebSockets and has to connect through various types of proxy servers. Most of them are HTTP CONNECT and SOCKS (4 and 5). I see, that you have support for HTTP CONNECT (even with auth), but not SOCKS.​

Is there any chance to make connection through SOCKS possible?

GamePad64 commented 8 years ago

Okay, I've inspected the code. All the changes can be made in <websocketpp/transport/asio/connection.hpp>

SOCKS4 can be added with minor changes, just replace HTTP CONNECT handshake sequence with SOCKS handshake sequence, and you are good. SOCKS5 is a bit more complicated, as it has two requests and replies in the handshake.

zaphoyd commented 8 years ago

Flagging this as a feature request. Your assessment of the work necessary sounds about right. Not sure when I will have time to personally see to it, but I would certainly work with anyone who wanted to write a PR for this to get it accepted.

zaphoyd commented 8 years ago

Relevant to this issue: #520 is going to track the development of a pluggable authenticated proxy interface. In theory this should allow folks to add their own proxy logic without needing to hack the core library.

AstoRut commented 6 years ago

@zaphoyd - Hi Peter, thank you for creating this WebSocket tool. I was wondering if you or anyone has implemented support for connecting through SOCKS proxies yet?