(conn net.Conn, targetAddr string)
| 243 | } |
| 244 | |
| 245 | func (c *SecureShell) handleForwardConnection(conn net.Conn, targetAddr string) { |
| 246 | defer conn.Close() |
| 247 | |
| 248 | target, err := c.secureClient.Dial("tcp", targetAddr) |
| 249 | if err != nil { |
| 250 | fmt.Printf("connect to %s failed: %s\n", targetAddr, err.Error()) |
| 251 | return |
| 252 | } |
| 253 | defer target.Close() |
| 254 | |
| 255 | wg := &sync.WaitGroup{} |
| 256 | wg.Add(2) |
| 257 | |
| 258 | go copyAndClose(wg, conn, target) |
| 259 | go copyAndClose(wg, target, conn) |
| 260 | wg.Wait() |
| 261 | } |
| 262 | |
| 263 | func (c *SecureShell) localForwardAcceptLoop(listener net.Listener, addr string) { |
| 264 | defer listener.Close() |
no test coverage detected