()
| 148 | } |
| 149 | |
| 150 | func (c *secureShell) LocalPortForward() error { |
| 151 | for _, forwardSpec := range c.opts.ForwardSpecs { |
| 152 | listener, err := c.listenerFactory.Listen("tcp", forwardSpec.ListenAddress) |
| 153 | if err != nil { |
| 154 | return err |
| 155 | } |
| 156 | c.localListeners = append(c.localListeners, listener) |
| 157 | |
| 158 | go c.localForwardAcceptLoop(listener, forwardSpec.ConnectAddress) |
| 159 | } |
| 160 | |
| 161 | return nil |
| 162 | } |
| 163 | |
| 164 | func (c *secureShell) localForwardAcceptLoop(listener net.Listener, addr string) { |
| 165 | defer listener.Close() |
nothing calls this directly
no test coverage detected