Versions in this module Expand all Collapse all v1 v1.0.0 Nov 4, 2022 Changes in this version + var CommandTCP byte = 1 + var CommandUDP byte = 3 + func ReadPacket(r io.Reader, payload []byte) (net.Addr, int, int, error) + func WritePacket(w io.Writer, socks5Addr, payload []byte) (int, error) + type Command = byte + type Option struct + ALPN []string + Password string + ServerName string + SkipCertVerify bool + type PacketConn struct + func (pc *PacketConn) ReadFrom(b []byte) (int, net.Addr, error) + func (pc *PacketConn) WriteTo(b []byte, addr net.Addr) (int, error) + type Trojan struct + func New(option *Option) *Trojan + func (t *Trojan) PacketConn(conn net.Conn) net.PacketConn + func (t *Trojan) StreamConn(conn net.Conn) (net.Conn, error) + func (t *Trojan) StreamWebsocketConn(conn net.Conn, wsOptions *WebsocketOption) (net.Conn, error) + func (t *Trojan) WriteHeader(w io.Writer, command Command, socks5Addr []byte) error + type WebsocketOption struct + Headers http.Header + Host string + Path string + Port string