I want to implement proxy support (SOCKS5 and HTTP CONNECT method) in my application. There are two parts that needs to be implemented:
- Detection of proxy details (protocol, host, port): I am using libproxy for that.
- Connecting to the the proxy server and telling it to relay the packets. Get the connected socket a开发者_如何转开发nd then use it in your application.
Is there library for the #2 part?
You might be able to hack libmicrohttpd into doing what you want without too much effort, at least as far as the user end. I'm not aware of anything that does what you want straight out of the box.
Now there is proxysocket (https://github.com/brechtsanders/proxysocket/) to do exactly that. Supports SOCKS4, SOCKS5 and HTTP CONNECT. The result is a normal connected socket so you don't have to rewrite the rest of your application.
libcurl can receive webpage via proxy. You can send raw http header to it, and let it talk to the proxy
精彩评论