tlswrapper

package module
v3.0.0-...-335bb84 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version  = "dev"
	Homepage = "https://github.com/hexian000/tlswrapper"
)
View Source
var (
	ErrNoDialAddress  = errors.New("no dial address is configured")
	ErrDialInProgress = errors.New("another dial is in progress")
)

Functions

func AppMain

func AppMain(f *AppFlags) int

func RunHTTPServer

func RunHTTPServer(l net.Listener, s *Server) error

Types

type AppFlags

type AppFlags struct {
	Help       bool
	Config     string
	DumpConfig bool
	ServerName string
	GenCerts   string
	Sign       string
	KeyType    string
	KeySize    int
}

func (*AppFlags) Validate

func (f *AppFlags) Validate() error

type EmptyHandler

type EmptyHandler struct{}

EmptyHandler rejects all connections

func (*EmptyHandler) Serve

func (h *EmptyHandler) Serve(_ context.Context, accepted net.Conn)

type ForwardHandler

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

ForwardHandler forwards connections to another plain address

func (*ForwardHandler) Serve

func (h *ForwardHandler) Serve(ctx context.Context, accepted net.Conn)

type Handler

type Handler interface {
	Serve(context.Context, net.Conn)
}

type Server

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

Server object

func NewServer

func NewServer(cfg *config.File) (*Server, error)

NewServer creates a server object

func (*Server) Listen

func (s *Server) Listen(addr string) (net.Listener, error)

func (*Server) LoadConfig

func (s *Server) LoadConfig(cfg *config.File) error

LoadConfig reloads the configuration file

func (*Server) Serve

func (s *Server) Serve(listener net.Listener, handler Handler)

func (*Server) Shutdown

func (s *Server) Shutdown() error

Shutdown gracefully

func (*Server) Start

func (s *Server) Start() error

Start the service

func (*Server) Stats

func (s *Server) Stats() (stats ServerStats)

type ServerStats

type ServerStats struct {
	NumSessions int
	NumStreams  int
	Rx, Tx      uint64
	Accepted    uint64
	Served      uint64
	Authorized  uint64
	ReqTotal    uint64
	ReqSuccess  uint64
	// contains filtered or unexported fields
}

type TLSHandler

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

TLSHandler creates a tunnel

func (*TLSHandler) Serve

func (h *TLSHandler) Serve(ctx context.Context, conn net.Conn)

func (*TLSHandler) Stats4Listener

func (h *TLSHandler) Stats4Listener() (numSessions uint32, numHalfOpen uint32)

type TunnelHandler

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

TunnelHandler forwards connections over the tunnel

func (*TunnelHandler) Serve

func (h *TunnelHandler) Serve(ctx context.Context, accepted net.Conn)

type TunnelStats

type TunnelStats struct {
	Name        string
	LastChanged time.Time
	NumSessions int
	NumStreams  int
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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