pipe

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package pipe implements the pipe logic, i.e. listening for TLS or UDP connections and proxying data to the target destination.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server represents an udptlspipe pipe. Depending on whether it is created in server- or client- mode, it listens to TLS or UDP connections and pipes the data to the destination.

func NewServer

func NewServer(
	listenAddr string,
	destinationAddr string,
	password string,
	proxyURL string,
	serverMode bool,
) (s *Server, err error)

NewServer creates a new instance of a *Server.

func (*Server) Addr

func (s *Server) Addr() (addr net.Addr)

Addr returns the address the pipe listens to if it is started or nil.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) (err error)

Shutdown stops the pipe and waits for all active connections to close.

func (*Server) Start

func (s *Server) Start() (err error)

Start starts the pipe, exits immediately if it failed to start listening. Start returns once all servers are considered up.

func (*Server) String

func (s *Server) String() (str string)

String implements the fmt.Stringer interface for *Server.

Jump to

Keyboard shortcuts

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