Documentation
¶
Index ¶
- func ConnectTunnel(ctx context.Context, cfg Config) (net.PacketConn, *http3.Transport, *connectip.Conn, *http.Response, error)
- func PrepareTlsConfig(privKey *ecdsa.PrivateKey, peerPubKey *ecdsa.PublicKey, cert [][]byte, ...) (*tls.Config, error)
- type Config
- type DialContextFunc
- type ListenPacketFunc
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectTunnel ¶
func ConnectTunnel(ctx context.Context, cfg Config) (net.PacketConn, *http3.Transport, *connectip.Conn, *http.Response, error)
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 ¶
DialContextFunc matches SagerNet / sing-box outbound TCP dialers
type ListenPacketFunc ¶
ListenPacketFunc matches SagerNet / sing-box outbound UDP dialers
Click to show internal directories.
Click to hide internal directories.