proxy

package
v0.0.0-...-dc6ae1d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LocalToRemote

func LocalToRemote(ctx context.Context, lst net.Listener, wsBase, token, tunnelID string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL