service

package
v0.0.0-...-7938e08 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Factory = sync.Map{}

Functions

This section is empty.

Types

type BufferOpt

type BufferOpt struct {
	ReadBufferSize    int
	WriteBufferSize   int
	EnableCompression bool
}

type GRPCService

type GRPCService struct {
	pb.UnimplementedTunnelServer
	// contains filtered or unexported fields
}

func (GRPCService) Conn

func (g GRPCService) Conn(ctx context.Context, t transfer.Type, sOpts ...Option) (net.Conn, error)

func (GRPCService) Http

func (g GRPCService) Http(server pb.Tunnel_HttpServer) error

func (GRPCService) Serve

func (g GRPCService) Serve(ln net.Listener, srvOpt ...Option) error

func (GRPCService) Socks5

func (g GRPCService) Socks5(server pb.Tunnel_Socks5Server) error

type KeepAliveOpt

type KeepAliveOpt struct {
	MinTime           time.Duration
	MaxTime           time.Duration
	Timeout           time.Duration
	HandshakeTimeout  time.Duration
	MaxConnectionIdle time.Duration

	PermitStream bool
}

type Option

type Option func(o *Options)

func WithAddr

func WithAddr(addr string) Option

func WithBuffers

func WithBuffers(b *BufferOpt) Option

func WithKeepAlive

func WithKeepAlive(k *KeepAliveOpt) Option

func WithTLSConf

func WithTLSConf(t *tls.Config) Option

func WithTorFlag

func WithTorFlag(tor bool) Option

type Options

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

type Service

type Service interface {
	Conn(ctx context.Context, t transfer.Type, sOpts ...Option) (net.Conn, error)
	Serve(ln net.Listener, srvOpt ...Option) error
}

type WSService

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

func (*WSService) Conn

func (s *WSService) Conn(ctx context.Context, t transfer.Type, sOpts ...Option) (net.Conn, error)

func (*WSService) Serve

func (s *WSService) Serve(ln net.Listener, sOpts ...Option) error

Jump to

Keyboard shortcuts

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