Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2238,7 +2238,7 @@ usage: -m [-h] [--tunnel-hostname TUNNEL_HOSTNAME] [--tunnel-port TUNNEL_PORT]
[--filtered-url-regex-config FILTERED_URL_REGEX_CONFIG]
[--cloudflare-dns-mode CLOUDFLARE_DNS_MODE]

proxy.py v2.4.0rc7.dev12+gd234339.d20220116
proxy.py v2.4.0rc7.dev15+gc4ea34e

options:
-h, --help show this help message and exit
Expand Down Expand Up @@ -2279,13 +2279,13 @@ options:
Default: None. Unix socket path to use. When provided
--host and --port flags are ignored
--local-executor LOCAL_EXECUTOR
Default: 1. Enabled by default. Use 0 to disable. When
enabled acceptors will make use of local (same
process) executor instead of distributing load across
remote (other process) executors. Enable this option
to achieve CPU affinity between acceptors and
executors, instead of using underlying OS kernel
scheduling algorithm.
Default: 1. Enabled by default (except on Windows).
Use 0 to disable. When enabled acceptors will make use
of local (same process) executor instead of
distributing load across remote (other process)
executors. Enable this option to achieve CPU affinity
between acceptors and executors, instead of using
underlying OS kernel scheduling algorithm.
--num-acceptors NUM_ACCEPTORS
Defaults to number of CPU cores.
--version, -v Prints proxy.py version.
Expand Down
2 changes: 1 addition & 1 deletion proxy/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def _env_threadless_compliant() -> bool:
DEFAULT_STATIC_SERVER_DIR = os.path.join(PROXY_PY_DIR, "public")
DEFAULT_MIN_COMPRESSION_LIMIT = 20 # In bytes
DEFAULT_THREADLESS = _env_threadless_compliant()
DEFAULT_LOCAL_EXECUTOR = True
DEFAULT_LOCAL_EXECUTOR = not IS_WINDOWS
DEFAULT_TIMEOUT = 10.0
DEFAULT_VERSION = False
DEFAULT_HTTP_PORT = 80
Expand Down
2 changes: 1 addition & 1 deletion proxy/core/acceptor/acceptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
type=int,
default=int(DEFAULT_LOCAL_EXECUTOR),
help='Default: ' + ('1' if DEFAULT_LOCAL_EXECUTOR else '0') + '. ' +
'Enabled by default. Use 0 to disable. When enabled acceptors ' +
'Enabled by default (except on Windows). Use 0 to disable. When enabled acceptors ' +
'will make use of local (same process) executor instead of distributing load across ' +
'remote (other process) executors. Enable this option to achieve CPU affinity between ' +
'acceptors and executors, instead of using underlying OS kernel scheduling algorithm.',
Expand Down
90 changes: 57 additions & 33 deletions tests/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,52 +37,76 @@ def _tls_interception_flags(ca_cert_suffix: str = '') -> str:
))


PROXY_PY_FLAGS_INTEGRATION = (
('--threadless'),
_PROXY_PY_FLAGS_INTEGRATION = [
('--threadless --local-executor 0'),
('--threaded'),
)

PROXY_PY_HTTPS = (
('--threadless ' + _https_server_flags()),
]
if not IS_WINDOWS:
_PROXY_PY_FLAGS_INTEGRATION += [
('--threadless'),
('--threaded'),
]
PROXY_PY_FLAGS_INTEGRATION = tuple(_PROXY_PY_FLAGS_INTEGRATION)

_PROXY_PY_HTTPS = [
('--threadless --local-executor 0 ' + _https_server_flags()),
('--threaded ' + _https_server_flags()),
)

PROXY_PY_FLAGS_TLS_INTERCEPTION = (
('--threadless ' + _tls_interception_flags()),
]
if not IS_WINDOWS:
_PROXY_PY_HTTPS += [
('--threadless ' + _https_server_flags()),
('--threaded ' + _https_server_flags()),
]
PROXY_PY_HTTPS = tuple(_PROXY_PY_HTTPS)

_PROXY_PY_FLAGS_TLS_INTERCEPTION = [
('--threadless --local-executor 0 ' + _tls_interception_flags()),
('--threaded ' + _tls_interception_flags()),
)

PROXY_PY_FLAGS_MODIFY_CHUNK_RESPONSE_PLUGIN = (
(
'--threadless --plugin proxy.plugin.ModifyChunkResponsePlugin ' +
_tls_interception_flags('-chunk')
),
]
if not IS_WINDOWS:
_PROXY_PY_FLAGS_TLS_INTERCEPTION += [
('--threadless ' + _tls_interception_flags()),
('--threaded ' + _tls_interception_flags()),
]
PROXY_PY_FLAGS_TLS_INTERCEPTION = tuple(_PROXY_PY_FLAGS_TLS_INTERCEPTION)

_PROXY_PY_FLAGS_MODIFY_CHUNK_RESPONSE_PLUGIN = [
(
'--threadless --local-executor 0 --plugin proxy.plugin.ModifyChunkResponsePlugin ' +
_tls_interception_flags('-chunk')
),
(
'--threaded --plugin proxy.plugin.ModifyChunkResponsePlugin ' +
_tls_interception_flags('-chunk')
),
]
if not IS_WINDOWS:
_PROXY_PY_FLAGS_MODIFY_CHUNK_RESPONSE_PLUGIN += [
(
'--threadless --plugin proxy.plugin.ModifyChunkResponsePlugin ' +
_tls_interception_flags('-chunk')
),
(
'--threaded --plugin proxy.plugin.ModifyChunkResponsePlugin ' +
_tls_interception_flags('-chunk')
),
]
PROXY_PY_FLAGS_MODIFY_CHUNK_RESPONSE_PLUGIN = tuple(
_PROXY_PY_FLAGS_MODIFY_CHUNK_RESPONSE_PLUGIN,
)

PROXY_PY_FLAGS_MODIFY_POST_DATA_PLUGIN = (
(
'--threadless --plugin proxy.plugin.ModifyPostDataPlugin ' +
_tls_interception_flags('-post')
),
_PROXY_PY_FLAGS_MODIFY_POST_DATA_PLUGIN = [
(
'--threadless --local-executor 0 --plugin proxy.plugin.ModifyPostDataPlugin ' +
_tls_interception_flags('-post')
),
(
'--threaded --plugin proxy.plugin.ModifyPostDataPlugin ' +
_tls_interception_flags('-post')
),
]
if not IS_WINDOWS:
_PROXY_PY_FLAGS_MODIFY_POST_DATA_PLUGIN += [
(
'--threaded --plugin proxy.plugin.ModifyPostDataPlugin ' +
_tls_interception_flags('-post')
),
(
'--threadless --plugin proxy.plugin.ModifyPostDataPlugin ' +
_tls_interception_flags('-post')
),
]
PROXY_PY_FLAGS_MODIFY_POST_DATA_PLUGIN = tuple(
_PROXY_PY_FLAGS_MODIFY_POST_DATA_PLUGIN,
)


Expand Down