fix: close late proxy listeners and validate HTTP usernames - #22
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved blocking issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Fixes proxy shutdown races and validates usernames incompatible with HTTP/HTTPS authentication while preserving existing protocols and defaults.
Changes:
- Safely handles listener registration during shutdown.
- Treats normal shutdown as a successful
Servereturn. - Rejects colon-containing HTTP/HTTPS usernames and documents the restriction.
- Adds lifecycle and credential validation tests.
| File | Summary |
|---|---|
internal/proxy/socks5.go |
Handles late listener registration during shutdown. |
internal/proxy/lifecycle.go |
Coordinates shutdown state and listener ownership. |
internal/proxy/lifecycle_test.go |
Tests lifecycle races and listener ownership. |
internal/proxy/http.go |
Handles late listener registration and clean shutdown. |
docs/DEPLOYMENT.md |
Documents HTTP-compatible username restrictions. |
cmd/autocar/proxy_credentials_test.go |
Tests startup and offline credential validation. |
cmd/autocar/main_test.go |
Updates credential validation coverage. |
cmd/autocar/client.go |
Validates HTTP/HTTPS username compatibility. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix two local-proxy startup correctness issues without changing tunnel protocols, authentication wire formats, default configuration or release versions.
Verification
Exact PR head
87ea8a38ecd4a97163b77f3b08259657c464b4bcpassed CI, CodeQL and Linux namespace/netem integration. CI includes Linux/macOS tests, race detection, reachable vulnerability scanning, four-platform builds, actual Docker integration and the multi-platform OCI image build. No review change requests or open threads were present at merge preparation. No separate remote host or passive-traffic experiment is claimed; no tag or release is created.Post-merge verification: main commit
49b15b94b2e4f2ba28588d50e84e6ed91fb90ec6has the identical source treed005733e389fa3b392a66d5e2f899c6fe043e21band passed its own push-triggered CI, CodeQL and Linux namespace/netem integration.