-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Https proxy (via CONNECT) support #155
base: master
Are you sure you want to change the base?
Conversation
Use new docker compose, small cleanups
ec6256a
to
96008a5
Compare
@@ -0,0 +1,5 @@ | |||
#!/bin/bash | |||
|
|||
openssl req -x509 -newkey rsa:4096 -keyout test-key.pem -out test.pem -sha256 -days 3650 -nodes -subj "/C=XX/ST=Test/L=Test/OU=Test/O=Test/CN=localhost" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3000:80"
nginx:
build: nginx
ports:
- "3001:80"
- "3002:443"
links:
- "json:api"
squid:
build: squid
ports:
- "3003:3128"
links:
- "nginx:api.example.com"
socks:
image: jgaafromnorth/shinysocks
environment:
- LOG_LEVEL=trace
ports:
- "3004:1080"
links:
- "nginx:api.example.com"
@@ -0,0 +1,5 @@ | |||
#!/bin/bash | |||
|
|||
openssl req -x509 -newkey rsa:4096 -keyout test-key.pem -out test.pem -sha256 -days 3650 -nodes -subj "/C=XX/ST=Test/L=Test/OU=Test/O=Test/CN=localhost" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3000:80"
nginx:
build: nginx
ports:
- "3001:80"
- "3002:443"
links:
- "json:api"
squid:
build: squid
ports:
- "3003:3128"
links:
- "nginx:api.example.com"
socks:
image: jgaafromnorth/shinysocks
environment:
- LOG_LEVEL=trace
ports:
- "3004:1080"
links:
- "nginx:api.example.com"
If someone interested, I have added preliminary HTTPS proxy support, known as CONNECT proxy tunnel. It can be used to pass https requests through http proxy (this is how most proxies are working today).
New proxy type Request::Proxy::Type::HTTPS is added for CONNECT type proxy.
No proxy authentication support done yet. Sorry.
Example: (see https://github.com/jgaa/restc-cpp/blob/master/doc/Tutorial.md#send-a-request-going-trough-a-http-proxy)
Also I changed TlsSocket class, so we can pass unencrypted data over TLS socket before tls handshake is done. Otherwise we get tls unintialized protocol error (I know, code is imperfect, more ideas are welcome).
Though I haven't done much testing, sequental proxied requests correctly use the same cached connection to proxy.
If we send proxied requests asyncronously in parallel, they will open new proxy tunnels one for each request.
Testing nginx container is modified so it will serve https requests. Benefit from this, old https tests can be rewritten to request the local nginx instead of the public internet.