Versions in this module Expand all Collapse all v0 v0.2.2 Mar 11, 2022 Changes in this version + const NoAuth + const Socks5Version + const SuccessReply + func DecodeUint32(uintByte []byte) uint32 + func DialTrojan(config *client.Config, metadata *Metadata) (outbound net.Conn, err error) + func EncodeUint32(i uint32) []byte + func PeekTrojan(bufr *bufio.Reader, conn net.Conn) (bool, error) + func ReadByte(r io.Reader) (byte, error) + func ReadUint32(r io.Reader) (uint32, error) + type Address struct + DomainName string + NetworkType string + Port int + func NewAddressFromAddr(network string, addr string) (*Address, error) + func NewAddressFromHostPort(network string, host string, port int) *Address + func (a *Address) Network() string + func (a *Address) ReadFrom(r io.Reader) error + func (a *Address) ResolveIP() (net.IP, error) + func (a *Address) String() string + func (a *Address) WriteTo(w io.Writer) error + type AddressType byte + const DomainName + const IPv4 + const IPv6 + type Codec interface + Decode func(reader io.Reader) error + Encode func() ([]byte, error) + type Metadata struct + func (r *Metadata) Network() string + func (r *Metadata) ReadFrom(rr io.Reader) error + func (r *Metadata) String() string + func (r *Metadata) WriteTo(w io.Writer) error + type PeekReader struct + I int + R *bufio.Reader + func (p *PeekReader) Read(b []byte) (n int, err error) + type Socks5 struct + Conn net.Conn + Metadata *Metadata + func (s *Socks5) HandleHandshake() error + func (s *Socks5) LSTRequest() (err error) + func (s *Socks5) SendReply(resp uint8) error + type Trojan struct + Hash string + Metadata *Metadata + func (s *Trojan) Decode(reader io.Reader) error + func (s *Trojan) Encode() ([]byte, error)