Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LocalToRemote ¶
LocalToRemote takes connections from the given listener and proxies them through the given tunnel at wsBase using the provided token.
It only returns when lst.Accept returns an error
func RemoteToLocal ¶
func RemoteToLocal(ctx context.Context, wsBase, token, tunnelID string, dialer func(context.Context) (net.Conn, error)) error
RemoteToLocal opens a new tunnel on wsBase using the given tunnelID and tokens to authenticate.
Then, it will accept connections on the given tunnel in a loop, for each new connection from the tunnel it will use dialer to acquire a connection to a service running on the localhost.
Once that connection is obtained, it will start copying data between both connections.
It will only stop once hub.Accept fails
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.