MCPcopy
hub / github.com/kubernetes/client-go / ForwardPorts

Method ForwardPorts

tools/portforward/portforward.go:188–199  ·  view source on GitHub ↗

ForwardPorts formats and executes a port forwarding request. The connection will remain open until stopChan is closed.

()

Source from the content-addressed store, hash-verified

186// ForwardPorts formats and executes a port forwarding request. The connection will remain
187// open until stopChan is closed.
188func (pf *PortForwarder) ForwardPorts() error {
189 defer pf.Close()
190
191 var err error
192 pf.streamConn, _, err = pf.dialer.Dial(PortForwardProtocolV1Name)
193 if err != nil {
194 return fmt.Errorf("error upgrading connection: %s", err)
195 }
196 defer pf.streamConn.Close()
197
198 return pf.forward()
199}
200
201// forward dials the remote host specific in req, upgrades the request, starts
202// listeners for each port specified in ports, and forwards local connections

Calls 5

CloseMethod · 0.95
forwardMethod · 0.95
ErrorfMethod · 0.65
CloseMethod · 0.65
DialMethod · 0.45