-
-
Notifications
You must be signed in to change notification settings - Fork 618
[ConnectionPool] Add support for HTTPS request pooling #865
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
Conversation
add connection status check in read_from_descriptors
add tls parser skeleton
temporary commit
fix bugs when using connection pool with https
for more information, see https://pre-commit.ci
abhinavsingh
left a comment
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.
Thank you for this PR and work on https connection pool. This not only help with within TLS interception mode but also at every place where proxy.py or plugins needs to establish a HTTPS connection upstream.
I'll run it locally and also try to dig into multiprocessing aspects. But we should be able to merge this in as-in (with green CI :)) and need not wait for multiprocessing support to land within this PR.
I'll update back with my findings. Meanwhile try to address these lint warnings. I know they might seem annoying but are necessary and sometimes might even help you find bugs in the code. PTAL at https://github.com/abhinavsingh/proxy.py/runs/4504222230?check_suite_focus=true
This comment has been minimized.
This comment has been minimized.
|
@JerryKwan Can you check in the |
abhinavsingh
left a comment
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.
PTAL. Also add the missing tls_server_hello.data file. Thank you
|
I made several changes related to list here JerryKwan#4. Please take a look and merge into your merge, which in-turn will update this PR. You will have to additionally address the comments I left before PR will become merge ready (green CI). Let me know if you run into any issues. Thank you. |
Https conn pool
bug fix in tls.py add test data for tls parser
bug fix in tls parser
for more information, see https://pre-commit.ci
Codecov Report
@@ Coverage Diff @@
## develop #865 +/- ##
===========================================
+ Coverage 86.90% 86.96% +0.05%
===========================================
Files 130 130
Lines 5843 5845 +2
Branches 586 586
===========================================
+ Hits 5078 5083 +5
+ Misses 656 652 -4
- Partials 109 110 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
remove unnecessary tls parser and related tests
fix spell check warnings
|
@JerryKwan Awesome looks like all has been resolved. Docker problems are due to permission issues. I'll take another look later today and merge if all looks good. Thank you!!! |
|
Agree. These lines should be commented out
…On Tue, Dec 21, 2021 at 11:57 PM Abhinav Singh ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In proxy/core/connection/connection.py
<#865 (comment)>:
> @@ -52,6 +52,7 @@ def connection(self) -> Union[ssl.SSLSocket, socket.socket]:
def send(self, data: bytes) -> int:
"""Users must handle BrokenPipeError exceptions"""
# logger.info(data)
+ logger.info('send to %s, data = |%s|', self.tag, data)
I didn't get you. By having a logger.info in send, instance will keep
printing all data sent to client and servers (even encrypted data). So we
should not have this enabled. At-best we must have .debug, but even in
debug mode, printing all raw data gets too verbose.
There is a reason I have a commented out line above. I uncomment it when
necessary for local debugging.
------------------------------
In proxy/core/connection/connection.py
<#865 (comment)>:
> @@ -66,6 +67,7 @@ def recv(
(len(data), self.tag),
)
# logger.info(data)
+ logger.info('recv from %s, data = |%s|', self.tag, data)
Same here, we should not keep this line. Comment this out.
—
Reply to this email directly, view it on GitHub
<#865 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHRXINI5VOUEERKWWTHGGLUSCPXZANCNFSM5J5SWUTQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
remove unnecessary statements
remove unused imports
Here is how to try
HTTPSconnection pooling. Currently only available whenTLS Interceptionis enabled and within a single worker (no multiprocessing support yet)You can use the following commands to do some tests:
Generate required certificates
make ca-certificatesStart proxy with TLS Interception enabled & with connection pool
Client
curl -v -x localhost:8899 --cacert ca-cert.pem https://httpbin.org/get