-
Notifications
You must be signed in to change notification settings - Fork 364
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Checking mergeability…
Don’t worry, you can still create the pull request.
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: qwj/python-proxy
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: by275/python-proxy
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 7 commits
- 7 files changed
- 3 contributors
Commits on Nov 17, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 19bc0b5 - Browse repository at this point
Copy the full SHA 19bc0b5View commit details
Commits on Feb 9, 2026
-
Configuration menu - View commit details
-
Copy full SHA for 0791bce - Browse repository at this point
Copy the full SHA 0791bceView commit details
Commits on Apr 18, 2026
-
Python 3.12 compatibility and proxy hot-path optimizations (#3)
* Add Python 3.12 asyncio compatibility updates - replace legacy asyncio task scheduling with create_task() in hot paths - switch loop access to get_running_loop() and explicit event loop setup for Python 3.12+ - move AuthTable auth caches from class state to instance state to avoid cross-connection leakage - update package metadata to declare Python 3.12+ support * Add gitignore for Python cache files - ignore __pycache__/ directories generated by local Python runs * Add local proxy benchmark script - compare direct, HTTP, and SOCKS relay throughput on a local echo server - report request rate, bandwidth, average latency, and p95 latency - allow running from the repository root without installing the package * Optimize HTTP and WebSocket header parsing - share HTTP/WS request-head parsing to reduce repeated decode(), split(), and temporary header dict creation - reuse filtered header bytes when rebuilding HTTP request lines in accept and channel paths - benchmark basis: compared current proto.py against commit 53a2919 with tests/benchmark_http_headers.py, 5 runs each, 20000 iterations, 20 extra headers - measured improvement: http_accept 17.58us -> 16.84us (~4.2% faster), http_channel 17.63us -> 16.85us (~4.4% faster), ws_accept 16.82us -> 15.68us (~6.8% faster) * Reduce drain frequency in relay loops - batch relay writes up to 256 KiB before awaiting drain() in generic and HTTP relay paths - keep forced drain() for response paths that must flush immediately - benchmark basis: compared current proto.py against commit f888a39 with tests/benchmark_proxy.py, 5 runs each, 400 requests, concurrency 20, payload 16384 bytes, warmup 3 - measured improvement: HTTP relay 9666 req/s -> 9818 req/s (~1.6% faster), SOCKS5 relay 8788 req/s -> 8907 req/s (~1.3% faster), with lower average latency on both paths * Optimize UDP relay bookkeeping - replace O(n) udpmap eviction scans with OrderedDict-based LRU tracking in ProxyDirect - reuse udpmap lookups and centralize touch/discard helpers for UDP connection state updates - preserve existing round-robin scheduling after rejecting the attempted rr cursor change - benchmark basis: synthetic UDP bookkeeping microbenchmark comparing previous min(update) eviction against the new LRU path across sizes 30, 100, 300, and 1000 - measured improvement: about +475% at size 30, +480% at size 100, +451% at size 300, and +724% at size 1000 * Reduce stat updater allocation overhead - replace nested lambda-based stat updaters with ConnectionStat and StatUpdater helper objects - keep the existing modstat call shape while avoiding repeated closure creation on connection setup - benchmark basis: synthetic modstat microbenchmark comparing the previous nested-lambda updater against the new object-based updater - measured improvement: 2189206 ops/s -> 3896353 ops/s (~78.0% faster) * Group relay tasks with asyncio.TaskGroup - add a relay_with_taskgroup helper and await paired inbound/outbound relay tasks inside stream_handler - keep the existing echo and empty fast paths unchanged while grouping the main bidirectional proxy relay lifecycle - benchmark basis: compared current server.py against commit 67523d9 with tests/benchmark_proxy.py, 5 runs each, 400 requests, concurrency 20, payload 8192 bytes, warmup 3 - validation result: no large regression observed; direct throughput changed from 23336 req/s to 22811 req/s (~-2.3%), HTTP from 9953 req/s to 10436 req/s (~+4.9%), and SOCKS5 from 10022 req/s to 9654 req/s (~-3.7%), with smoke benchmark and compileall both passing * Reduce byte-processing overhead in protocol hot paths - decode HTTP admin header blocks once and reuse both the header dict and rendered line text - switch HTTP request-line detection in http_channel() to the bytes-based matcher to avoid per-chunk decode on the fast path - avoid extra bytes reallocation in SOCKS domain parsing by splitting the length byte from the host payload - centralize WebSocket frame masking with xor_mask_bytes() to simplify the byte-processing path used for masking and unmasking - validation: python3 -m compileall pproxy and python3 tests/benchmark_proxy.py --requests 50 --concurrency 5 --payload-size 4096 --warmup 1 both passed * Clean up asyncio task imports and Transparent interface - replace module-level create_task aliases with from asyncio import create_task in proto.py and server.py - add a default Transparent.query_remote() implementation so static analysis can see the required interface
Configuration menu - View commit details
-
Copy full SHA for 5fa9b14 - Browse repository at this point
Copy the full SHA 5fa9b14View commit details -
Configuration menu - View commit details
-
Copy full SHA for b22652a - Browse repository at this point
Copy the full SHA b22652aView commit details -
Configuration menu - View commit details
-
Copy full SHA for d96a60e - Browse repository at this point
Copy the full SHA d96a60eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ffe502 - Browse repository at this point
Copy the full SHA 9ffe502View commit details
Commits on Apr 19, 2026
-
Configuration menu - View commit details
-
Copy full SHA for 768d87a - Browse repository at this point
Copy the full SHA 768d87aView commit details
Loading
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff master...master