Skip to content

[Multiport] Prepare for listening on multiple ports #1031

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 12 commits into from
Jan 22, 2022
Merged

Conversation

abhinavsingh
Copy link
Owner

@abhinavsingh abhinavsingh commented Jan 21, 2022

  • Add --ports flag, which is a list of integers, defaults to empty list
  • Usage:
    • --ports 8900: Will result in listening on 8899 and 8900
    • --port 9000 --ports 9001 9002: Will result in listening on 9000-9002

@abhinavsingh abhinavsingh added the bot:chronographer:skip PR using this label is exempted from CHANGELOG management label Jan 21, 2022
@abhinavsingh abhinavsingh marked this pull request as draft January 21, 2022 15:56
@codecov
Copy link

codecov bot commented Jan 22, 2022

Codecov Report

Attention: Patch coverage is 89.17197% with 17 lines in your changes missing coverage. Please review.

Project coverage is 85.79%. Comparing base (1569146) to head (c5cd8d0).
Report is 199 commits behind head on develop.

Files Patch % Lines
proxy/core/listener/pool.py 67.85% 7 Missing and 2 partials ⚠️
proxy/core/listener/base.py 84.84% 4 Missing and 1 partial ⚠️
proxy/proxy.py 76.92% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1031      +/-   ##
===========================================
- Coverage    85.83%   85.79%   -0.05%     
===========================================
  Files          146      150       +4     
  Lines         6396     6461      +65     
  Branches       648      655       +7     
===========================================
+ Hits          5490     5543      +53     
- Misses         800      808       +8     
- Partials       106      110       +4     
Flag Coverage Δ
pytest 85.60% <89.17%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@abhinavsingh abhinavsingh changed the title [Multiport] Add ability to listen on multiple ports [Multiport] Prepare for listening on multiple ports Jan 22, 2022
@abhinavsingh abhinavsingh marked this pull request as ready for review January 22, 2022 10:22
@abhinavsingh abhinavsingh merged commit cc126c3 into develop Jan 22, 2022
@abhinavsingh abhinavsingh deleted the multiport branch January 22, 2022 10:23
abhinavsingh added a commit that referenced this pull request Jan 24, 2022
* [Windows] Remove `--threadless` from `TestCase` (#1025)

[Windows] Remove `--threadless` from `TestCase`

* Handle `SIGINFO`.  Try `kill -s INFO <pid>`. (#1024)

* Handle `SIGINFO`.  Try `kill -s INFO <pid>`.

Also remove dirty hack added in flags to incorporate `--basic-auth`
flag.  Add `__pycache__` to ignore list.  Disable http proxy
during acceptor benchmark.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* not on windows

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* no cover

* # pylint: disable=E1101

* Curl retry on error and check_output 2 minute timeout

* check output timeout None

* Update `faulthandler_timeout` to 2 minutes

* Disable `test_circular_imports`, `isort` integration now works

* Fix curl flags

* Revert back to older flags

* SIGINFO attribute might not even exist

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Add a skeleton app to demonstrate how to use `proxy.py` for standalone projects (#1029)

* Add a skeleton app structure

* Update `README.md` for skeleton app

* Add `skeleton-app` to pre commit

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update readme

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Move `Tls` module within core (#1030)

* [ReverseProxy] Move within core lib with ability to write its plugin (#1033)

* Move reverse proxy core within core lib

* Fix main test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix doc and lint

* Fix lint

* Top level category for reverse plugin

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [Multiport] Prepare for listening on multiple ports (#1031)

* Convert `--port` to list of integers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Prepare for multiport listener

* Multi listeners, but will fail in theory as no port override is currently performed

* Separate `listener` module

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update flags in readme

* Fix imports in listener test

* Fix flag parsing for `port` and `ports`

* Fix tests

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [Multiport] `Acceptor` can now accept work from multiple descriptors (#1036)

* Update acceptor to accept work from multiple ports

* import order

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix acceptor tests

* Tweak

* fix tests

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [ReverseProxy] Add integration tests (#1037)

* Add reverse proxy integration test

* Fix reverse proxy url for https integration

* Enable reverse proxy for docker build and test

* [ReverseProxyPlugin] Remove redundant `ca_file` flag when wrapping upstream (#1046)

* Fix #1045

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* no conn log

* Do not edit host header by default

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [SOCKS4] Packet parser & builder (#1047)

* Initial commit

* Parse socks4 packet

* Lint check

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix lint issues

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add handler test skeleton

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [CacheByContentTypePlugin] Prepare for content type parsing (#1038)

* Move default cache directory within `proxy.py` instance data directory

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add `CacheByContentTypePlugin` skeleton and remove unnecessary mixin

* Fix startup issues after removal of mixin

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* .

* Fix broken mock

* doc fix

* doc

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [Work] Refactor for generic work type (#1048)

* Add `TcpOrTlsSocket` type

* isort

* Update to use Fd executor

* Define `HostPort` type

* Fix fileno

* spellfix

* [Work] Refactor as FD work (#1049)

* Abstract out FD based work implementation

* No need of local/remote abstractions

* fix type

* Add `BaseLocalExecutor`

* Fix lint and tests

* [BaseRemoteExecutor] Base executor for processing work remotely (#1050)

* Abstract out FD based work implementation

* No need of local/remote abstractions

* fix type

* Add `BaseLocalExecutor`

* Fix lint and tests

* Add a `BaseRemoteExecutor`

* [Work] `kwargs` independent `work_klass` creation and work core (#1051)

* `kwargs` independent work klass and core

* Fix tests

* Add a `create` method to base class

* Lint fixes

* Pre `v2.4.0rc8` cleanups (#1053)

* Pre-release cleanups

* Add listener pool test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add multi listener test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:skip PR using this label is exempted from CHANGELOG management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant