Documentation ¶
Index ¶
- Constants
- func ReadPacket(r io.Reader, payload []byte) (net.Addr, int, int, error)
- func WritePacket(w io.Writer, socks5Addr, payload []byte) (int, error)
- type Command
- type Option
- type PacketConn
- type 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
Constants ¶
View Source
const ( CommandTCP byte = 1 CommandUDP byte = 3 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PacketConn ¶
func (*PacketConn) WaitReadFrom ¶
func (pc *PacketConn) WaitReadFrom() (data []byte, put func(), addr net.Addr, err error)
type Trojan ¶
type Trojan struct {
// contains filtered or unexported fields
}
func (*Trojan) PacketConn ¶
func (t *Trojan) PacketConn(conn net.Conn) net.PacketConn
func (*Trojan) StreamConn ¶
func (*Trojan) StreamWebsocketConn ¶
Click to show internal directories.
Click to hide internal directories.