-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[PYTHON-2943] : Add socks5 proxy support #2040
base: master
Are you sure you want to change the base?
[PYTHON-2943] : Add socks5 proxy support #2040
Conversation
5a132e7
to
768bf17
Compare
768bf17
to
4682dac
Compare
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.
Looks good so far, thank you!
pymongo/client_options.py
Outdated
@@ -170,6 +170,15 @@ def _parse_pool_options( | |||
ssl_context, tls_allow_invalid_hostnames = _parse_ssl_options(options) | |||
load_balanced = options.get("loadbalanced") | |||
max_connecting = options.get("maxconnecting", common.MAX_CONNECTING) | |||
if proxy_host := options.get("proxyHost"): | |||
proxy = { |
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.
proxy
seems like a boolean name, can we please rename to something like proxy_options
?
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.
Fixed
pymongo/asynchronous/pool.py
Outdated
if Proxy is None: | ||
raise RuntimeError( | ||
"In order to use SOCKS5 proxy, python_socks must be installed. " | ||
"This can be done by re-installing pymongo with `pip install pymongo[socks]`" |
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.
I think we should be more generic and say pymongo[proxy]
in case we switch to a different underlying library in the future.
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.
Done
The required tests are specified here. If you'd like to try running everything locally, I'd suggest something like the following: git clone https://github.com/mongodb-labs/drivers-evergreen-tools
cd drivers-evergreen-tools
bash .evergreen/setup.sh # create a standalone cli for https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/socks5srv.py
make run-server # start a server on 27017
./evergreen/socks5srv # run the cli Once you have the tests working locally, I can either help walk through the Evergreen Configuration portion, or just make commits to your branch if you prefer. |
I'm not sure how to add the tests to work with proxy on your environment |
No description provided.