masque

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectTunnel

ConnectTunnel establishes a Connect-IP tunnel with the provided configuration. When UseHTTP2 is false it dials over QUIC/HTTP3; when true it dials over TCP/HTTP2.

func PrepareTlsConfig

func PrepareTlsConfig(privKey *ecdsa.PrivateKey, peerPubKey *ecdsa.PublicKey, cert [][]byte, sni string, insecure bool) (*tls.Config, error)

PrepareTlsConfig creates a TLS configuration using the provided certificate and SNI (Server Name Indication). It also verifies the peer's public key against the provided public key.

Types

type Config

type Config struct {
	TLSConfig    *tls.Config
	QuicConfig   *quic.Config
	ConnectURI   string
	Endpoint     net.Addr
	UseHTTP2     bool
	DialContext  DialContextFunc
	ListenPacket ListenPacketFunc
	Logger       Logger
}

Config holds options for establishing a MASQUE connection

type DialContextFunc

type DialContextFunc func(ctx context.Context, network, address string) (net.Conn, error)

DialContextFunc matches SagerNet / sing-box outbound TCP dialers

type ListenPacketFunc

type ListenPacketFunc func(ctx context.Context, network, address string) (net.PacketConn, error)

ListenPacketFunc matches SagerNet / sing-box outbound UDP dialers

type Logger

type Logger interface {
	Printf(format string, v ...any)
}

Logger defines a simple logger interface compatible with standard and sing-box loggers

Jump to

Keyboard shortcuts

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