Skip to content

kafka.net: Add HttpConnectProxy#2990

Open
ZivBleich wants to merge 1 commit into
dpkp:masterfrom
ZivBleich:ZivBleich/http-connect-proxy
Open

kafka.net: Add HttpConnectProxy#2990
ZivBleich wants to merge 1 commit into
dpkp:masterfrom
ZivBleich:ZivBleich/http-connect-proxy

Conversation

@ZivBleich
Copy link
Copy Markdown

@ZivBleich ZivBleich commented May 25, 2026

Changes:

  • kafka/net/http_connect.py: new HttpConnectProxy class
  • kafka/net/__init__.py: import and export HttpConnectProxy alongside Socks5Proxy

Tests:

  • pytest test/net/test_http_connect.py -v
  • pytest test/net/ -q
  • pylint --errors-only kafka/net/http_connect.py
  • git diff --check

ZivBleich added a commit to ZivBleich/kafka-python that referenced this pull request May 25, 2026
@ZivBleich ZivBleich force-pushed the ZivBleich/http-connect-proxy branch from 0258773 to 3023bbf Compare May 25, 2026 08:41
@ZivBleich ZivBleich marked this pull request as draft May 25, 2026 08:43
@ZivBleich ZivBleich force-pushed the ZivBleich/http-connect-proxy branch from 3023bbf to baa42aa Compare May 25, 2026 08:45
@ZivBleich ZivBleich marked this pull request as ready for review May 25, 2026 08:52
@dpkp
Copy link
Copy Markdown
Owner

dpkp commented May 25, 2026

Thanks, the project is currently in an unreleased major transition from 2.x -> 3.x. You can leave the packaging issues unresolved for now (I will fix before publishing). I think if we're going to support more than one proxy I would like to use an abstract proxy interface and subclass it and avoid adding additional conditional checks.

The pylint error seems unrelated to this PR. I'm not sure why it's popping up now.

@dpkp
Copy link
Copy Markdown
Owner

dpkp commented May 25, 2026

I'll land a quick refactor w/ abstract interface that you can leverage instead.

@ZivBleich
Copy link
Copy Markdown
Author

Thanks, the project is currently in an unreleased major transition from 2.x -> 3.x. You can leave the packaging issues unresolved for now (I will fix before publishing). I think if we're going to support more than one proxy I would like to use an abstract proxy interface and subclass it and avoid adding additional conditional checks.

The pylint error seems unrelated to this PR. I'm not sure why it's popping up now.

Thank you!

@dpkp
Copy link
Copy Markdown
Owner

dpkp commented May 26, 2026

See #2992

@ZivBleich ZivBleich marked this pull request as draft May 27, 2026 07:32
@ZivBleich ZivBleich force-pushed the ZivBleich/http-connect-proxy branch from baa42aa to 6380e1c Compare May 27, 2026 08:01
@ZivBleich ZivBleich changed the title feat: Add HTTP CONNECT proxy support (http_connect_proxy=) feat: Add HTTP CONNECT proxy support May 27, 2026
@ZivBleich ZivBleich force-pushed the ZivBleich/http-connect-proxy branch from 6380e1c to 3f7655f Compare May 27, 2026 08:04
Adds HttpConnectProxy, registered for the `http` scheme, which tunnels
broker connections through an HTTP CONNECT proxy. Pass
proxy_url='http://host:port' (or 'http://user:pass@host:port' for basic
auth) to KafkaConsumer/KafkaProducer/KafkaAdminClient.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ZivBleich ZivBleich force-pushed the ZivBleich/http-connect-proxy branch from 7aeb792 to a58e173 Compare May 27, 2026 08:15
@ZivBleich ZivBleich changed the title feat: Add HTTP CONNECT proxy support kafka.net: Add HttpConnectProxy May 27, 2026
@ZivBleich ZivBleich marked this pull request as ready for review May 27, 2026 12:46
@ZivBleich
Copy link
Copy Markdown
Author

See #2992

Done refactoring the PR to match it.

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