Repository navigation
Conversation
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.
Summary
This pull request modernizes the project internals while preserving the existing CLI, URI grammar, public factory API, and proxy wire compatibility for Python 3.12+ Git installations.
It focuses on compatibility-preserving refactoring, clearer module boundaries, lifecycle ownership, and reproducible validation.
Compatibility
pproxy.Connection,pproxy.Server,pproxy.Rule, andpproxy.DIRECT.pproxy.protocompatibility facade and legacy protocol class names.start_server(args)and the existing argument shape.No intentional breaking change is included in this PR.
Main changes
Packaging and development
pyproject.tomlwhile retainingsetup.pyas a compatibility shim.Protocol and transport boundaries
pproxy.transportpackage while preserving the legacy import path.pproxy.protocolsmodules for address parsing, base protocols, HTTP, SOCKS, transparent protocols, WebSocket, and registry dispatch.pproxy.protoas a compatibility facade.Runtime lifecycle
pproxy.runtime.TaskRegistryfor owned background tasks.wait_closed(),aclose(), and async context-manager support where applicable.close()and existing server startup behavior.Correctness and safety
pproxy.observability.Performance
docs/PERFORMANCE.md.Final structural review against commit
8337a1bremained within the 5% proxy throughput gate:7030.8 -> 7046.9 req/s(+0.2%)7404.2 -> 7497.1 req/s(+1.3%)30.26 -> 30.24 us(-0.1%)26.66 -> 27.16 us(+1.9%)Validation
47unittest contract cases pass under normal Python.47unittest contract cases pass underpython -O.47pytest cases pass.compileallpasses.--versionand-hchecks pass.Follow-up work
Further work can be handled separately after this compatibility-focused modernization, including expanded optional-backend integration coverage, deeper private asyncio/H2/H3/QUIC API isolation, and additional
pyperfmicrobenchmarks after real workload profiling.Review request
Please review this as an internal modernization and compatibility-preserving refactor. The intended merge strategy is squash merge into
master.