fix(py): align anonymous client API with httpx - #310
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds HTTP proxy support and a streaming API to both the Python and Node.js implementations of Impit. It bumps the version from 0.7.3 to 0.8.0 for Python and includes related dependency updates.
Key changes:
- Adds HTTP proxy support alongside existing SOCKS proxy support for both Python and Node.js
- Introduces a new
stream()function for Python's client-less API - Extends client-less API functions with
proxy,follow_redirects,max_redirects,cookie_jar, andcookiesparameters - Adds proxy server testing infrastructure using
pproxy(Python) andproxy-chain(Node.js)
Reviewed Changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| impit-python/uv.lock | Updates package versions (0.7.3 → 0.8.0) and adds pproxy 2.7.9 dependency; updates exceptiongroup typing-extensions marker |
| impit-python/test/setup_proxy.py | New utility module for starting/stopping pproxy test server |
| impit-python/test/no_client_test.py | New comprehensive test suite for client-less API including proxy, redirects, cookies, and streaming |
| impit-python/test/basic_client_test.py | Adds HTTP proxy test case for Client class |
| impit-python/test/async_client_test.py | Adds HTTP proxy test case for AsyncClient class |
| impit-python/src/lib.rs | Implements new stream() function and extends client-less API functions with proxy/redirect/cookie parameters |
| impit-python/python/impit/impit.pyi | Adds type stubs for new stream() function and extended parameters on client-less API functions |
| impit-python/python/impit/init.py | Exports new stream function |
| impit-python/pyproject.toml | Adds pproxy>=2.7.9 dev dependency and mypy ignore configuration for pproxy |
| impit-node/yarn.lock | Updates package versions to 0.7.0 and adds proxy-chain 2.5.9 dependency |
| impit-node/test/mock.server.ts | Adds runProxyServer utility for testing HTTP proxy functionality |
| impit-node/test/basics.test.ts | Extends proxy tests to include HTTP proxy alongside SOCKS4/5 |
| impit-node/package.json | Adds proxy-chain dev dependency and reorders optionalDependencies alphabetically |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Start the local server | ||
| await getServer(); | ||
| // Start the proxy server | ||
| await getProxyServer() |
There was a problem hiding this comment.
Missing semicolon at the end of the statement.
Suggested change
| await getProxyServer() | |
| await getProxyServer(); |
Comment on lines
+10
to
+11
| from impit import Cookies, StreamClosed, StreamConsumed, TooManyRedirects | ||
|
|
There was a problem hiding this comment.
Module 'impit' is imported with both 'import' and 'import from'.
Suggested change
| from impit import Cookies, StreamClosed, StreamConsumed, TooManyRedirects |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Aligns anonymous client API (e.g.
impit.get()) withhttpxcapabilities. Adds proxy tests to the JS version of the package.closes #308