mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 07:08:10 +00:00
warn about nonfunctioning options, permanently remove unused ones.
If you are affected by this change, please do reach out by filing an issue.
This commit is contained in:
parent
67a93239f4
commit
455fee1126
@ -43,6 +43,9 @@ If you depend on these features, please raise your voice in
|
||||
* Remove all deprecated pathod and pathoc tools and modules (@Kriechi)
|
||||
* In reverse proxy mode, mitmproxy now does not assume TLS if no scheme
|
||||
is given but a custom port is provided (@mhils)
|
||||
* Remove the following options: `http2_priority`, `relax_http_form_validation`, `upstream_bind_address`,
|
||||
`spoof_source_address`, and `stream_websockets`. If you depended on one of them please let us know.
|
||||
mitmproxy never phones home, which means we don't know how prominently these options were used. (@mhils)
|
||||
* --- TODO: add new PRs above this line ---
|
||||
* ... and various other fixes, documentation improvements, dependency version bumps, etc.
|
||||
|
||||
|
@ -42,6 +42,10 @@ class Core:
|
||||
"add_upstream_certs_to_client_chain requires the upstream_cert option to be enabled."
|
||||
)
|
||||
if "body_size_limit" in updated:
|
||||
if opts.body_size_limit: # pragma: no cover
|
||||
ctx.log.warn(
|
||||
"body_size_limit is currently nonfunctioning, "
|
||||
"see https://github.com/mitmproxy/mitmproxy/issues/4348")
|
||||
try:
|
||||
human.parse_size(opts.body_size_limit)
|
||||
except ValueError:
|
||||
|
@ -19,13 +19,6 @@ class StreamBodies:
|
||||
Understands k/m/g suffixes, i.e. 3m for 3 megabytes.
|
||||
"""
|
||||
)
|
||||
loader.add_option(
|
||||
"stream_websockets", bool, False,
|
||||
"""
|
||||
Stream WebSocket messages between client and server.
|
||||
Messages are captured and cannot be modified.
|
||||
"""
|
||||
)
|
||||
|
||||
def configure(self, updated):
|
||||
if "stream_large_bodies" in updated and ctx.options.stream_large_bodies:
|
||||
@ -54,11 +47,3 @@ class StreamBodies:
|
||||
|
||||
def responseheaders(self, f):
|
||||
self.run(f, False)
|
||||
|
||||
def websocket_start(self, f):
|
||||
if ctx.options.stream_websockets:
|
||||
f.stream = True
|
||||
ctx.log.info("Streaming WebSocket messages between {client} and {server}".format(
|
||||
client=human.format_address(f.client_conn.peername),
|
||||
server=human.format_address(f.server_conn.address))
|
||||
)
|
||||
|
@ -47,6 +47,9 @@ class UpstreamAuth():
|
||||
if ctx.options.upstream_auth is None:
|
||||
self.auth = None
|
||||
else:
|
||||
if ctx.options.upstream_auth: # pragma: no cover
|
||||
ctx.log.warn("upstream_auth is currently nonfunctioning, "
|
||||
"see https://github.com/mitmproxy/mitmproxy/issues/4348")
|
||||
self.auth = parse_upstream_auth(ctx.options.upstream_auth)
|
||||
|
||||
def http_connect(self, f):
|
||||
|
@ -83,10 +83,6 @@ class Options(optmanager.OptManager):
|
||||
"listen_port", int, LISTEN_PORT,
|
||||
"Proxy service port."
|
||||
)
|
||||
self.add_option(
|
||||
"upstream_bind_address", str, "",
|
||||
"Address to bind upstream requests to."
|
||||
)
|
||||
self.add_option(
|
||||
"mode", str, "regular",
|
||||
"""
|
||||
@ -105,13 +101,6 @@ class Options(optmanager.OptManager):
|
||||
"Enable/disable HTTP/2 support. "
|
||||
"HTTP/2 support is enabled by default.",
|
||||
)
|
||||
self.add_option(
|
||||
"http2_priority", bool, False,
|
||||
"""
|
||||
PRIORITY forwarding for HTTP/2 connections. Disabled by default to ensure compatibility
|
||||
with misbehaving servers.
|
||||
"""
|
||||
)
|
||||
self.add_option(
|
||||
"websocket", bool, True,
|
||||
"Enable/disable WebSocket support. "
|
||||
@ -122,14 +111,6 @@ class Options(optmanager.OptManager):
|
||||
"Enable/disable raw TCP connections. "
|
||||
"TCP connections are enabled by default. "
|
||||
)
|
||||
|
||||
self.add_option(
|
||||
"spoof_source_address", bool, False,
|
||||
"""
|
||||
Use the client's IP for server-side connections. Combine with
|
||||
--upstream-bind-address to spoof a fixed source address.
|
||||
"""
|
||||
)
|
||||
self.add_option(
|
||||
"ssl_insecure", bool, False,
|
||||
"Do not verify upstream server SSL/TLS certificates."
|
||||
@ -166,11 +147,5 @@ class Options(optmanager.OptManager):
|
||||
TLS key size for certificates and CA.
|
||||
"""
|
||||
)
|
||||
self.add_option(
|
||||
"relax_http_form_validation", bool, False,
|
||||
"""
|
||||
Disable HTTP form validation.
|
||||
"""
|
||||
)
|
||||
|
||||
self.update(**kwargs)
|
||||
|
@ -71,7 +71,6 @@ REPLACEMENTS = {
|
||||
"--order": "view_order",
|
||||
"--no-mouse": "console_mouse",
|
||||
"--reverse": "view_order_reversed",
|
||||
"--no-http2-priority": "http2_priority",
|
||||
"--no-websocket": "websocket",
|
||||
"--no-upstream-cert": "upstream_cert",
|
||||
"--upstream-trusted-confdir": "ssl_verify_upstream_trusted_confdir",
|
||||
|
@ -29,9 +29,3 @@ def test_simple():
|
||||
f = tflow.tflow(resp=True)
|
||||
f.response.headers["content-length"] = "invalid"
|
||||
tctx.cycle(sa, f)
|
||||
|
||||
tctx.configure(sa, stream_websockets = True)
|
||||
f = tflow.twebsocketflow()
|
||||
assert not f.stream
|
||||
sa.websocket_start(f)
|
||||
assert f.stream
|
||||
|
Loading…
Reference in New Issue
Block a user