(loc net.Conn)
| 63 | } |
| 64 | |
| 65 | func (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 | |
| 75 | func (t *SSHTun) Close() { |
| 76 | t.Lock() |