Help us shape the future of Go! Take the 2026 Go Developer Survey

unbounded

package
v0.0.162 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package unbounded implements a consumer-side Unbounded outbound for sing-box.

Unbounded is Lantern's WebRTC-based peer-to-peer circumvention system. A volunteer "producer" (a browser tab running the Unbounded widget) pairs with a "consumer" (this outbound). The consumer sends QUIC-over-data-channel to the producer, which forwards it to an egress server that speaks plain internet.

Architecture in the refactored radiance

The outbound lives entirely inside the VPN tunnel process (the Android VPN service, the iOS/macOS NetworkExtension, the Windows service, or the Linux daemon). That makes the plumbing simpler than the split-process design:

  • broflake + pion run in the same process that owns the TUN
  • signaling to freddie goes out the physical interface because the hosting process injects a kindling-backed RoundTripper via adapter.ContextWithDirectTransport
  • STUN/DTLS to the peer goes through the sing-box dialer — we bind straight to the physical interface via the direct outbound, which in turn applies VpnService.protect / IP_BOUND_IF automatically

Options

option.UnboundedOutboundOptions holds only JSON-serializable fields. Runtime-only deps (HTTP transport for signaling, logger) come in via the sing-box logger interface and the ctx, respectively.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterOutbound

func RegisterOutbound(registry *outbound.Registry)

RegisterOutbound registers the Unbounded outbound with the given sing-box OutboundRegistry.

Types

type Outbound

type Outbound struct {
	outbound.Adapter
	// contains filtered or unexported fields
}

Outbound is the consumer-side Unbounded outbound.

Construction (NewOutbound) collects options and produces a zero-value broflake tree. The WebRTC + QUIC machinery doesn't spin up until Start is called at PostStart — that's when the tunnel's direct outbound is ready to accept dials, so any earlier attempt would hit "no available network interface" on Android.

func (*Outbound) Close

func (o *Outbound) Close() error

func (*Outbound) DialContext

func (o *Outbound) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*Outbound) ListenPacket

func (o *Outbound) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

func (*Outbound) Start

func (o *Outbound) Start(stage adapter.StartStage) error

Start brings broflake up and begins maintaining the QUIC connection to the paired peer. Runs at PostStart so the tunnel's direct outbound is ready.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL