Add SIP003U UDP relay support#331
Open
MichaelSuen-thePointer wants to merge 1 commit into
Open
Conversation
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
This PR adds SIP003U UDP relay support to v2ray-plugin while preserving the existing SIP003 TCP plugin behavior by default.
SIP003U extends the SIP003 plugin model with UDP forwarding support. The original SIP003U proposal/discussion is here:
shadowsocks/shadowsocks-org#180
For the Shadowsocks side,
shadowsocks-rustalready has SIP003U plugin-mode support. The relatedshadowsocks-rustdiscussion/reference is:shadowsocks/shadowsocks-rust#1127
Plugin-side implementation
The UDP relay added here is implemented in the plugin itself using
quic-goand QUIC Datagram frames:udpMode=quic;quic-go;udpTimeout;This UDP support is intentionally not based on v2ray. The v2ray stack is still used for the existing TCP stream path, while SIP003U UDP forwarding is a separate plugin-side QUIC Datagram relay.
Known limitation
There is still one known issue in this branch: when the Shadowsocks-side mode is
udp_only, v2ray-plugin currently still opens/listens on the TCP plugin port. UDP forwarding itself uses the new QUIC Datagram relay, but the TCP listener lifecycle has not yet been fully suppressed forudp_only.Compatibility notes
There are already SIP003U-capable Shadowsocks implementations on the Shadowsocks side, including
shadowsocks-rust.I also have a working SIP003U branch for
shadowsocks-libevhere:https://github.com/MichaelSuen-thePointer/shadowsocks-libev/tree/feature/sip003u
Testing
The branch includes parser/config tests and UDP relay tests covering the new SIP003U code path.