Versions in this module Expand all Collapse all v1 v1.19.0 Dec 9, 2024 v1.18.10 Oct 21, 2024 v1.18.9 Sep 29, 2024 v1.18.8 Sep 2, 2024 v1.18.7 Jul 28, 2024 v1.18.6 Jul 1, 2024 v1.18.5 May 18, 2024 v1.18.4 Apr 29, 2024 v1.18.3 Mar 29, 2024 v1.18.2 Mar 27, 2024 v1.18.1 Feb 2, 2024 v1.18.0 Jan 2, 2024 v1.17.1 Dec 2, 2023 v1.17.0 Dec 2, 2023 Changes in this version + const AtypDomainName + const AtypIPv4 + const AtypIPv6 + const AuthenticateType + const AuthenticationFailed + const AuthenticationTimeout + const BadCommand + const ConnectType + const DissociateType + const HeartbeatType + const PacketType + const ProtocolError + const ResponseType + const VER + var PacketOverHead = NewPacket(0, 0, NewAddressAddrPort(netip.AddrPortFrom(netip.IPv6Unspecified(), 0)), nil).BytesLen() + func GenTKN(token string) [32]byte + func NewServerHandler(option *ServerOption, quicConn quic.EarlyConnection, uuid uuid.UUID) common.ServerHandler + type Address struct + ADDR []byte + PORT uint16 + TYPE byte + func NewAddress(metadata *C.Metadata) Address + func NewAddressAddrPort(addrPort netip.AddrPort) Address + func NewAddressNetAddr(addr net.Addr) (Address, error) + func ReadAddress(reader BufferedReader) (c Address, err error) + func (c Address) BytesLen() int + func (c Address) SocksAddr() socks5.Addr + func (c Address) String() string + func (c Address) UDPAddr() *net.UDPAddr + func (c Address) WriteTo(writer BufferedWriter) (err error) + type Authenticate struct + TKN [32]byte + func NewAuthenticate(TKN [32]byte) Authenticate + func ReadAuthenticate(reader BufferedReader) (c Authenticate, err error) + func ReadAuthenticateWithHead(head CommandHead, reader BufferedReader) (c Authenticate, err error) + func (c Authenticate) BytesLen() int + func (c Authenticate) WriteTo(writer BufferedWriter) (err error) + type BufferedReader interface + type BufferedWriter interface + type Client struct + func NewClient(clientOption *ClientOption, udp bool, dialerRef C.Dialer) *Client + func (t *Client) DialContextWithDialer(ctx context.Context, metadata *C.Metadata, dialer C.Dialer, ...) (net.Conn, error) + func (t *Client) ListenPacketWithDialer(ctx context.Context, metadata *C.Metadata, dialer C.Dialer, ...) (net.PacketConn, error) + func (t Client) Close() + func (t Client) DialerRef() C.Dialer + func (t Client) LastVisited() time.Time + func (t Client) OpenStreams() int64 + func (t Client) SetLastVisited(last time.Time) + type ClientOption struct + CWND int + CongestionController string + FastOpen bool + MaxOpenStreams int64 + MaxUdpRelayPacketSize int + QuicConfig *quic.Config + ReduceRtt bool + RequestTimeout time.Duration + TlsConfig *tls.Config + Token [32]byte + UdpRelayMode common.UdpRelayMode + type CommandHead struct + TYPE CommandType + VER byte + func NewCommandHead(TYPE CommandType) CommandHead + func ReadCommandHead(reader BufferedReader) (c CommandHead, err error) + func (c CommandHead) BytesLen() int + func (c CommandHead) WriteTo(writer BufferedWriter) (err error) + type CommandType byte + func (c CommandType) BytesLen() int + func (c CommandType) String() string + type Connect struct + ADDR Address + func NewConnect(ADDR Address) Connect + func ReadConnect(reader BufferedReader) (c Connect, err error) + func ReadConnectWithHead(head CommandHead, reader BufferedReader) (c Connect, err error) + func (c Connect) BytesLen() int + func (c Connect) WriteTo(writer BufferedWriter) (err error) + type Dissociate struct + ASSOC_ID uint32 + func NewDissociate(ASSOC_ID uint32) Dissociate + func ReadDissociate(reader BufferedReader) (c Dissociate, err error) + func ReadDissociateWithHead(head CommandHead, reader BufferedReader) (c Dissociate, err error) + func (c Dissociate) BytesLen() int + func (c Dissociate) WriteTo(writer BufferedWriter) (err error) + type Heartbeat struct + func NewHeartbeat() Heartbeat + func ReadHeartbeat(reader BufferedReader) (c Heartbeat, err error) + func ReadHeartbeatWithHead(head CommandHead, reader BufferedReader) (c Heartbeat, err error) + type Packet struct + ADDR Address + ASSOC_ID uint32 + DATA []byte + LEN uint16 + func NewPacket(ASSOC_ID uint32, LEN uint16, ADDR Address, DATA []byte) Packet + func ReadPacket(reader BufferedReader) (c Packet, err error) + func ReadPacketWithHead(head CommandHead, reader BufferedReader) (c Packet, err error) + func (c Packet) BytesLen() int + func (c Packet) WriteTo(writer BufferedWriter) (err error) + type Response struct + REP byte + func NewResponse(REP byte) Response + func NewResponseFailed() Response + func NewResponseSucceed() Response + func ReadResponse(reader BufferedReader) (c Response, err error) + func ReadResponseWithHead(head CommandHead, reader BufferedReader) (c Response, err error) + func (c Response) BytesLen() int + func (c Response) IsFailed() bool + func (c Response) IsSucceed() bool + func (c Response) WriteTo(writer BufferedWriter) (err error) + type ServerOption struct + HandleTcpFn func(conn net.Conn, addr socks5.Addr, additions ...inbound.Addition) error + HandleUdpFn func(addr socks5.Addr, packet C.UDPPacket, additions ...inbound.Addition) error + MaxUdpRelayPacketSize int + Tokens [][32]byte