MCPcopy Create free account
hub / github.com/evilsocket/shellz / forward

Method forward

session/ssh_tun.go:65–73  ·  view source on GitHub ↗
(loc net.Conn)

Source from the content-addressed store, hash-verified

63}
64
65func (t *SSHTun) forward(loc net.Conn) {
66 log.Debug("forwarding %s -> %s", loc.LocalAddr().String(), loc.RemoteAddr().String())
67 if rem, err := t.client.Dial("tcp", t.tunnel.Remote.String()); err != nil {
68 log.Error("error while dialing %s: %s", t.tunnel.Remote.String(), err)
69 } else {
70 go t.pipe(loc, rem)
71 go t.pipe(rem, loc)
72 }
73}
74
75func (t *SSHTun) Close() {
76 t.Lock()

Callers 1

startMethod · 0.95

Calls 4

pipeMethod · 0.95
DebugMethod · 0.80
ErrorMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected