Skip to content

feat: add captive portal detection#60

Open
mkarim1378 wants to merge 1 commit into
masterking32:python_testingfrom
mkarim1378:feature/captive-portal-detection-pr
Open

feat: add captive portal detection#60
mkarim1378 wants to merge 1 commit into
masterking32:python_testingfrom
mkarim1378:feature/captive-portal-detection-pr

Conversation

@mkarim1378
Copy link
Copy Markdown

Summary

  • Adds src/core/captive_portal.py: async probe() hits
    connectivitycheck.gstatic.com/generate_204 before listeners open;
    any non-204 response is treated as a captive portal
  • startup_check(): logs a clear warning with the portal URL so users
    know exactly why the relay won't work
  • Background monitor() task: re-probes every 30s and logs state
    transitions (portal active / cleared) during the session
  • main.py: new --skip-captive-check flag; wires both functions into
    _run() before server.start(); respects captive_portal.enabled
  • config.example.json: documents the new captive_portal section

Motivation

When behind a hotel/café/office captive portal, all relay requests fail
silently with opaque 502 errors. This gives an immediate, actionable
warning instead.

Probes connectivitycheck.gstatic.com/generate_204 before opening
listeners. Any non-204 response (redirect, HTML) is treated as a
captive portal and logged as a clear warning with the portal URL.
A background task re-probes every 30s and logs state transitions.

- src/core/captive_portal.py: async probe(), startup_check(), monitor()
- main.py: --skip-captive-check flag; wires startup check and monitor
  task into _run() before server.start(); respects captive_portal.enabled
- config.example.json: adds captive_portal section (enabled,
  open_browser, check_interval)
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