icicleio / http

HTTP component for Icicle
MIT License
61 stars 5 forks source link

Web and socks proxy [feature request] #15

Open tak3r opened 8 years ago

tak3r commented 8 years ago

I'm just wondering whether http(s) and socks proxy are in the roadmap too?

trowski commented 8 years ago

https is already implemented on the server and client. On the server a PEM file must be passed as the 'pem' option to Icicle\Http\Server\Server::listen() (see the options array on the create() method of Icicle\Socket\Server\ServeryFactory). You can enable SSL/TLS on socket connections using the Icicle\Socket\Socket::enableCrypto() method. If you are using Icicle\Http\Client\Client, this should be handled for you if you provide an https url. You can see this in action by changing http:// to https:// in the client.php example.

SOCKS requires connecting to an intermediate proxy server to actually send the HTTP request. You can implement this yourself by manually making the connection to the SOCKS server, then using this connection to send requests using Icicle\Http\Client\Requester. I didn't plan on adding a class to implement this since it is fairly straightforward to do yourself. However, contributions are always welcome if you do write something for SOCKS.

tak3r commented 8 years ago

https is already implemented on the server and client. On the server a PEM file must be passed as the 'pem' option to Icicle\Http\Server\Server::listen() (see the options array on the create() method of Icicle\Socket\Server\ServeryFactory). You can enable SSL/TLS on socket connections using the Icicle\Socket\Socket::enableCrypto() method. If you are using Icicle\Http\Client\Client, this should be handled for you if you provide an https url. You can see this in action by changing http:// to https:// in the client.php example.

From my understanding, this is for requesting http(s) request directly. What happen if I want to send a http(s) request through a web proxy server?