Versions in this module Expand all Collapse all v1 v1.0.2 Apr 25, 2024 v1.0.1 Apr 24, 2024 Changes in this version + const CommandTCP + const CommandUDP + 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 + ClientFingerprint string + Fingerprint string + Password string + Reality *tlsC.RealityConfig + ServerName string + SkipCertVerify bool + type PacketConn struct + func (pc *PacketConn) ReadFrom(b []byte) (int, net.Addr, error) + func (pc *PacketConn) WaitReadFrom() (data []byte, put func(), addr net.Addr, err 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(ctx context.Context, conn net.Conn) (net.Conn, error) + func (t *Trojan) StreamWebsocketConn(ctx context.Context, 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 + V2rayHttpUpgrade bool + V2rayHttpUpgradeFastOpen bool