(req *statute.ProxyRequest)
| 18 | } |
| 19 | |
| 20 | func 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected