MCPcopy
hub / github.com/cloudfoundry/cli / LocalPortForward

Method LocalPortForward

cf/ssh/ssh.go:150–162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

148}
149
150func (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
164func (c *secureShell) localForwardAcceptLoop(listener net.Listener, addr string) {
165 defer listener.Close()

Callers

nothing calls this directly

Calls 2

ListenMethod · 0.65

Tested by

no test coverage detected