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

water

package
v0.0.164 Latest Latest
Warning

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

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

Documentation

Overview

Package water implements the WATER protocol inbound/outbound. You can find more info about the protocol here: https://github.com/refraction-networking/water

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInbound

func NewInbound(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.WATERInboundOptions) (adapter.Inbound, error)

NewInbound creates a new WATER inbound adapter.

func NewOutbound

func NewOutbound(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.WATEROutboundOptions) (adapter.Outbound, error)

NewOutbound creates a new WATER outbound adapter.

func RegisterInbound

func RegisterInbound(registry *inbound.Registry)

RegisterInbound registers the WATER inbound with the given registry.

func RegisterOutbound

func RegisterOutbound(registry *outbound.Registry)

RegisterOutbound registers the WATER outbound adapter with the given registry.

Types

type Inbound

type Inbound struct {
	inbound.Adapter
	// contains filtered or unexported fields
}

Inbound represents a WATER inbound sing-box adapter.

func (*Inbound) Close

func (i *Inbound) Close() error

Close stops the WATER inbound listener.

func (*Inbound) Start

func (i *Inbound) Start(stage adapter.StartStage) error

Start starts the WATER inbound adapter.

type Outbound

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

Outbound represents a WATER outbound adapter.

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)

DialContext dials a connection to the specified network and destination.

func (*Outbound) ListenPacket

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

ListenPacket creates a UoT packet connection through the WATER transport.

Jump to

Keyboard shortcuts

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