mike820324 / microProxy

A http/https interceptor written in pure python.
MIT License
17 stars 3 forks source link

[Proposal]: Add Http proxy support. #202

Closed mike820324 closed 7 years ago

mike820324 commented 7 years ago

Adding HTTP Proxy Support. There may be two cases when firefox is configured as http proxy,

Survey:

Firefox Behavior:

GET http://www.google.com HTTP/1.1\r\n
...
CONNECT https://www.google.com HTTP/1.1\r\n
User-Agent: xxx
Proxy-Connection: keep-alive
Connection: keep-alive
Host: www.google.com:443\r\n\r\n

The following curl command serve the same functionality.

curl --proxy http://127.0.0.1:5580 http://www.google.com
curl --proxy http://127.0.0.1:5580 https://www.google.com

P.S curl also has the proxytunnel option, which will force all the query to use connect instead.

curl --proxy http://127.0.0.1:5580 --proxytunnel http://www.google.com
chhsiao90 commented 7 years ago
curl --proxy http://127.0.0.1:5580 http://www.google.com
curl --proxy http://127.0.0.1:5580 https://www.google.com

Maybe you mean

curl --proxy http://127.0.0.1:5580 https://www.google.com
curl --proxy http://127.0.0.1:5580 --proxytunnel https://www.google.com
mike820324 commented 7 years ago

Yes, the proxytunnel options will force curl to use CONNECT in every protocol.

The above comment that I want to describe is how http client such as curl and firefox handle http proxy in different situations. :)

So if one want to check the CONNECT method, either

or

If one want to check the other way,

Sorry for the misunderstanding.

mike820324 commented 7 years ago

Closed via #235