Skip to content

Support mitmproxy local mode without listen port conflict - #32

Open
hoanle0126 wants to merge 1 commit into
appium:masterfrom
hoanle0126:fix/local-mode-23
Open

hoanle0126 wants to merge 1 commit into
appium:masterfrom
hoanle0126:fix/local-mode-23

Conversation

@hoanle0126

Copy link
Copy Markdown

When --mode local (or -m local) is passed in extraMitmdumpParams without a port-based mode, mitmproxy uses the OS local redirector and rejects -p <proxyPort> during startup (Error logged during startup, exiting...). In addition, local mode does not bind a TCP proxy port, so polling new Socket(LOCALHOST_IP, proxyPort) in waitForPortToBeInUse always times out.

This change:

  • Omits -p <proxyPort> when extraMitmdumpParams configures local mode only (--mode local / -m local).
  • Waits for the Python addon WebSocket connection to MitmproxyServer (ws://127.0.0.1:8765) instead of polling proxyPort when running in local mode only.
  • Fails fast in waitForPortToBeInUse and waitForLocalModeToStart if the mitmdump process exits prematurely during startup instead of waiting for the 5-minute socket timeout.

Fixes #23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mitmproxy mode local doesn't work in mitmproxy-java

1 participant