client

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadFromSession

func ReadFromSession(conf *Config, session *common.Session, sessionsOut chan<- *common.Session)

func ReceiveData

func ReceiveData(conf *Config, st pb.Tunnel_InitTunnelClient, sessionsOut chan<- *common.Session, host string, port int32, scheme string)

func RunClient

func RunClient(ctx context.Context, opts ...Option) error

RunClient creates a GRPC tunnel client

func SendData

func SendData(conf *Config, stream pb.Tunnel_InitTunnelClient, sessions <-chan *common.Session)

Types

type Config added in v1.4.7

type Config struct {
	TLS bool
	// contains filtered or unexported fields
}

Config is a config object used to configure a GRPC tunnel from the client side. ClientOption should be used to modify this

type Message

type Message struct {
	// contains filtered or unexported fields
}

type Option added in v1.4.7

type Option func(*Config) error

Option is an option able to be configured

func WithLogger

func WithLogger(l log.FieldLogger) Option

WithLogger sets the logger to be used by the server. if not set, output will be discarded

func WithServer

func WithServer(host string, p int) Option

WithServer configures the server this client uses

func WithTLS

func WithTLS(cert, tlsHostOverride string) Option

WithTLS configures the tunnel to use TLS and sets the certificate expected, and a optional tls hostname override.

func WithTunnels

func WithTunnels(scheme string, tunnels ...string) Option

WithTunnels configures the tunnels to be exposed by this client. Each string should be in the format of: localPort:remotePort

Jump to

Keyboard shortcuts

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