MCPcopy Create free account
hub / github.com/bepass-org/proxy / generalHandler

Function generalHandler

example/customHandler/main.go:20–34  ·  view source on GitHub ↗
(req *statute.ProxyRequest)

Source from the content-addressed store, hash-verified

18}
19
20func generalHandler(req *statute.ProxyRequest) error {
21 fmt.Println("handling request to", req.Destination)
22 conn, err := net.Dial(req.Network, req.Destination)
23 if err != nil {
24 return err
25 }
26 go func() {
27 _, err := io.Copy(conn, req.Conn)
28 if err != nil {
29 log.Println(err)
30 }
31 }()
32 _, err = io.Copy(req.Conn, conn)
33 return err
34}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected