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

Function NewSimplePacketServer

simplepacketserver.go:36–43  ·  view source on GitHub ↗
(password []byte, src string, client net.Conn, timeout int, dst []byte)

Source from the content-addressed store, hash-verified

34}
35
36func NewSimplePacketServer(password []byte, src string, client net.Conn, timeout int, dst []byte) (Exchanger, error) {
37 s := &SimplePacketServer{Password: password, Client: client, Timeout: timeout, src: src}
38 s.RB = x.BP65507.Get().([]byte)
39 s.WB = x.BP65507.Get().([]byte)
40 s.dstl = copy(s.WB[:len(dst)], dst)
41 s.dst = socks5.ToAddress(dst[0], dst[1:s.dstl-2], dst[s.dstl-2:])
42 return ServerGate(s)
43}
44
45func (s *SimplePacketServer) Exchange(remote net.Conn) error {
46 go func() {

Callers 1

ListenAndServeMethod · 0.85

Calls 1

GetMethod · 0.80

Tested by

no test coverage detected