Skip to content

fix: keep relay in sync with active environment - #82

Open
wakaka6 wants to merge 1 commit into
nmhjklnm:masterfrom
wakaka6:fix/relay-env-sync
Open

fix: keep relay in sync with active environment#82
wakaka6 wants to merge 1 commit into
nmhjklnm:masterfrom
wakaka6:fix/relay-env-sync

Conversation

@wakaka6

@wakaka6 wakaka6 commented Jul 13, 2026

Copy link
Copy Markdown

Summary

  • stop the shared relay when a newly created environment becomes active
  • stop the relay when the active environment proxy changes or is removed
  • discard a running relay whose recorded proxy does not match the active environment before TUN verification
  • add regression coverage for relay lifecycle and proxy matching

Why

Relay state is global while proxy configuration is per environment. Creating an environment or changing the active proxy could leave a relay connected to the previous upstream. The health check could then probe that stale relay and attribute its failure to the current proxy.

Verification

  • bash scripts/test-relay-env-sync.sh
  • bash scripts/test-socks5h-probes.sh
  • ShellCheck at warning severity
  • Bash and JavaScript syntax checks
  • generated cac build consistency check
  • gitleaks scan

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