Versions in this module Expand all Collapse all v1 v1.18.12 Jul 2, 2024 v1.18.11 Jul 2, 2024 v1.18.10 Jul 2, 2024 v1.18.9 Jul 2, 2024 v1.18.8 Jul 2, 2024 Changes in this version + const AtypDomainName + const AtypIPv4 + const AtypIPv6 + const AtypNone + const AuthenticateType + const AuthenticationFailed + const AuthenticationTimeout + const BadCommand + const ConnectType + const DissociateType + const HeartbeatType + const PacketType + const ProtocolError + const VER + var MaxFragSize = 1200 - PacketOverHead - 3 + var PacketOverHead = NewPacket(0, 0, 0, 0, 0, NewAddressAddrPort(netip.AddrPortFrom(netip.IPv6Unspecified(), 0)), nil).BytesLen() + func GenToken(state quic.ConnectionState, uuid [16]byte, password string) (token [32]byte, err error) + 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 + TOKEN [32]byte + UUID [16]byte + func NewAuthenticate(UUID [16]byte, TOKEN [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 + MaxOpenStreams int64 + MaxUdpRelayPacketSize int + Password string + QuicConfig *quic.Config + ReduceRtt bool + TlsConfig *tls.Config + UdpRelayMode common.UdpRelayMode + Uuid [16]byte + 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 uint16 + func NewDissociate(ASSOC_ID uint16) 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 uint16 + DATA []byte + FRAG_ID uint8 + FRAG_TOTAL uint8 + PKT_ID uint16 + SIZE uint16 + func NewPacket(ASSOC_ID uint16, PKT_ID uint16, FRGA_TOTAL uint8, FRAG_ID uint8, SIZE uint16, ...) 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 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 + Users map[[16]byte]string