server

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(conf *Config) *tunnelServer

NewServer creates a new GRPC handler instance that can be attached to a GRPC server

func ReceiveData

func ReceiveData(conf *Config, stream pb.Tunnel_InitTunnelServer)

func RunServer

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

RunServer creates a GRPC tunnel

func SendData

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

SendData handles data coming from our TCP listener, via the sessions channel, and republishes it over GRPC

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 Server. ServerOption should be used to modify this

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 WithPort

func WithPort(p int) Option

WithPort configures the GRPC tunnel server to listen on a given port.

func WithTLS

func WithTLS(cert, key string) Option

WithTLS configures the GRPC tunnel server to use TLS

Jump to

Keyboard shortcuts

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