MCPcopy
hub / github.com/txthinking/brook / NewSimplePacketClient

Function NewSimplePacketClient

simplepacketclient.go:37–44  ·  view source on GitHub ↗
(password []byte, src string, server net.Conn, timeout int, dst []byte)

Source from the content-addressed store, hash-verified

35}
36
37func NewSimplePacketClient(password []byte, src string, server net.Conn, timeout int, dst []byte) (Exchanger, error) {
38 s := &SimplePacketClient{Password: password, Server: server, Timeout: timeout, src: src}
39 s.RB = x.BP65507.Get().([]byte)
40 s.WB = x.BP65507.Get().([]byte)
41 s.dstl = copy(s.WB[32+4:32+4+len(dst)], dst)
42 s.dst = socks5.ToAddress(dst[0], dst[1:s.dstl-2], dst[s.dstl-2:])
43 return ClientGate(s)
44}
45
46func (c *SimplePacketClient) Exchange(local net.Conn) error {
47 go func() {

Callers 2

UDPHandleMethod · 0.85
CreateExchangerMethod · 0.85

Calls 1

GetMethod · 0.80

Tested by

no test coverage detected