Skip to content

Add SIP003U UDP relay support#331

Open
MichaelSuen-thePointer wants to merge 1 commit into
shadowsocks:masterfrom
MichaelSuen-thePointer:feature/sip003u
Open

Add SIP003U UDP relay support#331
MichaelSuen-thePointer wants to merge 1 commit into
shadowsocks:masterfrom
MichaelSuen-thePointer:feature/sip003u

Conversation

@MichaelSuen-thePointer
Copy link
Copy Markdown

Note: this PR description was generated with AI assistance.

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-rust already has SIP003U plugin-mode support. The related shadowsocks-rust discussion/reference is:

shadowsocks/shadowsocks-rust#1127

Plugin-side implementation

The UDP relay added here is implemented in the plugin itself using quic-go and QUIC Datagram frames:

  • client/server UDP relay modes are selected with udpMode=quic;
  • QUIC Datagram support is enabled through quic-go;
  • UDP packets are encapsulated as plugin-level datagrams over a QUIC connection between the two plugin endpoints;
  • flow cleanup is handled by an idle timeout configurable with udpTimeout;
  • TCP behavior remains on the existing v2ray transport path.

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 for udp_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-libev here:

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.

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