MCPcopy Create free account
hub / github.com/cli/cli / NewPortForwarder

Function NewPortForwarder

internal/codespaces/portforwarder/port_forwarder.go:56–61  ·  view source on GitHub ↗

NewPortForwarder returns a new PortForwarder for the specified codespace.

(ctx context.Context, codespaceConnection *connection.CodespaceConnection)

Source from the content-addressed store, hash-verified

54
55// NewPortForwarder returns a new PortForwarder for the specified codespace.
56func NewPortForwarder(ctx context.Context, codespaceConnection *connection.CodespaceConnection) (fwd PortForwarder, err error) {
57 return &CodespacesPortForwarder{
58 connection: codespaceConnection,
59 keepAliveReason: make(chan string, 1),
60 }, nil
61}
62
63// ForwardPortToListener forwards the specified port to the given TCP listener.
64func (fwd *CodespacesPortForwarder) ForwardPortToListener(ctx context.Context, opts ForwardPortOpts, listener *net.TCPListener) error {

Callers 13

LogsMethod · 0.92
RebuildMethod · 0.92
SSHMethod · 0.92
printOpenSSHConfigMethod · 0.92
JupyterMethod · 0.92
ListPortsMethod · 0.92
UpdatePortVisibilityMethod · 0.92
ForwardPortsMethod · 0.92
PollPostCreateStatesFunction · 0.92
TestNewPortForwarderFunction · 0.85

Calls

no outgoing calls