-
Notifications
You must be signed in to change notification settings - Fork 0
add a unbounded endpoint that integrates unbounded into sing-box #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The unbounded endpoint can be configured (role) to run as an inbound (peer), and outbound (client), or as both at the same time. When running as inbound, it builds a WebRTC peer connection with another unbounded endpoint running as client role, receiving TCP/UDP requests over QUIC and routes to singbox. When running as outbound, it builds a WebRTC peer connection with another unbounded endpoint running as peer role, receiving TCP/UDP requests from singbox and hands over through the unbouned QUIC layer to the peer. For TCP it uses QUIC streams and for UDP it uses QUIC datagram.
UDP packet chunking Heartbeat from QUIC datagram from both client/server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR integrates the Unbounded transport into sing-box as a new “unbounded” endpoint, enabling it to operate in client, peer, or dual roles over QUIC and WebRTC.
- Adds
UDPOverQUICHandler
to multiplex UDP traffic over QUIC datagrams, with session management and keep-alive. - Implements
Endpoint
inendpoint.go
to configure and run Unbounded as outbound (client), inbound (peer), or both. - Registers the new protocol, updates options, constants, and dependencies (go.mod).
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
protocol/unbounded/udp.go | Implements UDP-over-QUIC handling, sessions, and routing |
protocol/unbounded/endpoint.go | Defines the Unbounded Endpoint adapter with client/peer logic |
protocol/unbounded/doc.go | Adds basic package documentation |
protocol/register.go | Registers Unbounded endpoint in the registry |
option/unbounded.go | Defines configuration options for the Unbounded endpoint |
go.mod | Bumps Go version and adds Unbounded-related dependencies |
constant/proxy.go | Adds the TypeUnbounded constant |
Comments suppressed due to low confidence (2)
option/unbounded.go:6
- The
WebRTCTag
option is never used inEndpoint
; the code generates its own UUID tags instead. If you intend to allow users to set this, wire it throughcreateClientOptions
andcreatePeerOptions
, or remove the unused field.
WebRTCTag string `json:"webrtc_tag"` // might need to separate this tag for inbound (peer) and outbound (client)
protocol/unbounded/endpoint.go:205
- The
Role
field accepts any string at runtime but only supportsclient
,peer
, orboth
. Add explicit validation and return an error for unsupported values to fail fast on misconfiguration.
switch options.Role {
This points to unmerged PRs: quicwrapper: jovis/2035-support-singbox-pr unbounded: jovis/2035-support-singbox-pr And this one updates to latest main: telemetry: current main Also use github.com/sagernet/sing instead of lantern's because of building with these tags will fail: ❯ go build -tags with_utls,with_quic .../global/pkg/mod/github.com/getlantern/[email protected]/route/route.go:527:39: undefined: M.IsDomainName .../global/pkg/mod/github.com/getlantern/[email protected]/route/route.go:625:41: undefined: M.IsDomainName
dafad42
to
b60638d
Compare
This PR adds unbounded to sing-box as an
endpoint
, that can be configured to run as 3 different roles:See more details in the ticket #2035 about implementation details and decisions.
This is part of #2035 and depends on other 2 PRs to be merged first.