Skip to content

Support connections through SOCKS5 proxies #2531

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

Merged
merged 1 commit into from
Mar 14, 2025
Merged

Conversation

dpkp
Copy link
Owner

@dpkp dpkp commented Mar 14, 2025

Implement support for SOCKS5 proxies. Implement a new proxy wrapper that handles SOCKS5 connection, authentication and requesting connections to the actual Kafka broker endpoints.

The proxy can be configured via a new keyword argument socks5_proxy to consumers, producers or admin client. The value is URL with optional username and password. E.g.
socks5://user:[email protected]:10800

The implementation is done in state machine that makes progress on repeated calls to connect_ex. The rationale with this bit strange design is to minimize amount of changes on the actual BrokerConnection object.

(rebase of #2169)

@dpkp dpkp force-pushed the hnousiainen/socks5_support branch 2 times, most recently from 83fc583 to 93c6871 Compare March 14, 2025 18:14
Implement support for SOCKS5 proxies. Implement a new proxy wrapper
that handles SOCKS5 connection, authentication and requesting
connections to the actual Kafka broker endpoints.

The proxy can be configured via a new keyword argument `socks5_proxy`
to consumers, producers or admin client. The value is URL with optional
username and password. E.g.
`socks5://user:[email protected]:10800`

The implementation is done in state machine that makes progress on
repeated calls to connect_ex. The rationale with this bit strange
design is to minimize amount of changes on the actual BrokerConnection
object.
@dpkp dpkp force-pushed the hnousiainen/socks5_support branch from 93c6871 to 2e95c0b Compare March 14, 2025 20:04
@dpkp dpkp merged commit f7c234d into master Mar 14, 2025
16 checks passed
@dpkp dpkp deleted the hnousiainen/socks5_support branch March 14, 2025 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants