Skip to content

Fix explicit HTTPS port handling for reverse proxies - #77

Open
BlackRockCity wants to merge 1 commit into
Python-roborock:mainfrom
BlackRockCity:patch-1
Open

Fix explicit HTTPS port handling for reverse proxies#77
BlackRockCity wants to merge 1 commit into
Python-roborock:mainfrom
BlackRockCity:patch-1

Conversation

@BlackRockCity

Copy link
Copy Markdown

This change makes sure the script keeps using port 443 when it is explicitly specified, instead of accidentally switching to port 555. This is important when a reverse proxy receives the connection on port 443 and then forwards it to the local server on port 555.

Technically, the change keeps two forms of the local API address: one that preserves the explicitly configured :443 for the mitmproxy addon, and a second, normalized HTTPS address used only for the preflight check. This prevents normalization of the preflight URL from altering the port information later used to route intercepted traffic.

Tested successfully with HAProxy on pfSense listening on port 443 and forwarding to the local Roborock server on port 555.

This change makes sure the script keeps using port 443 when that is the port you specified, instead of accidentally switching to port 555. This is important when a reverse proxy receives the connection on port 443 and then forwards it to the local server on port 555.

Technically, the change keeps two forms of the local API address: one that preserves the explicitly configured port for the mitmproxy addon, and a second, normalized HTTPS address used only for the preflight check. This prevents normalization of the preflight URL from altering the port information later used to route intercepted traffic.

Tested successfully with HAProxy on pfSense listening on port 443 and forwarding to the local Roborock server on port 555.
@BlackRockCity

Copy link
Copy Markdown
Author

This is analogous to the reverse-proxy port handling addressed for MQTT in PR #73, but applies to the HTTPS/local API path used by the mitmproxy addon and preflight check.

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.

1 participant