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