MCPcopy Index your code
hub / github.com/windtf/wireproxy / connForward

Function connForward

routine.go:212–220  ·  view source on GitHub ↗

connForward copy data from `from` to `to`

(from io.ReadWriteCloser, to io.ReadWriteCloser)

Source from the content-addressed store, hash-verified

210
211// connForward copy data from `from` to `to`
212func connForward(from io.ReadWriteCloser, to io.ReadWriteCloser) {
213 defer func() { _ = from.Close() }()
214 defer func() { _ = to.Close() }()
215
216 _, err := io.Copy(to, from)
217 if err != nil {
218 errorLogger.Printf("Cannot forward traffic: %s\n", err.Error())
219 }
220}
221
222// tcpClientForward starts a new connection via wireguard and forward traffic from `conn`
223func tcpClientForward(vt *VirtualTun, raddr *addressPort, conn net.Conn) {

Callers 3

tcpClientForwardFunction · 0.85
STDIOTcpForwardFunction · 0.85
tcpServerForwardFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected