fix(jetsocat): validate JMUX listener destination at CLI parse time#1823
Merged
Benoît Cortier (CBenoit) merged 1 commit intoJun 11, 2026
Merged
Conversation
Previously, a `tcp-listen://<addr>/<destination>` argument without a port (e.g. a missing `:22`) was accepted at startup, but every incoming connection was then silently dropped with only a debug-level log. The tunnel appeared to work yet forwarded nothing. The listener destination is now parsed during CLI argument parsing, so a malformed destination fails immediately and visibly with a clear error, before any listener is bound.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves jetsocat jmux-proxy reliability by validating the JMUX TCP listener destination during CLI parsing, so malformed destinations fail fast with a clear error instead of causing silent runtime drops.
Changes:
- Add a CLI regression test ensuring a missing destination port fails during argument parsing.
- Parse
tcp-listen://<bind>/<destination>destinations intoDestinationUrlat CLI parse time (rather than per-connection at runtime). - Refactor TCP listener handling to carry a parsed
DestinationUrland emit higher-visibility warnings on JMUX API failures.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| testsuite/tests/cli/jetsocat.rs | Adds a regression test asserting missing destination port is rejected during CLI parsing. |
| jetsocat/src/main.rs | Parses/validates TCP listener destination into DestinationUrl during CLI arg parsing. |
| jetsocat/src/listener.rs | Switches TCP listener to use parsed DestinationUrl and removes per-connection destination parsing. |
| crates/jmux-proto/src/lib.rs | Introduces DestinationUrl::with_scheme and refactors parse_str to use it. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+88
to
+89
| Self::with_scheme(scheme, rest) | ||
| } |
Marc-André Moreau (mamoreau-devolutions)
approved these changes
Jun 11, 2026
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.
Previously, a
tcp-listen://<addr>/<destination>argument without a port (e.g. a missing:22) was accepted at startup, but every incoming connection was then silently dropped with only a debug-level log. The tunnel appeared to work yet forwarded nothing.The listener destination is now parsed during CLI argument parsing, so a malformed destination fails immediately and visibly with a clear error, before any listener is bound.