tunnel

package
v2.5.4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2025 License: GPL-3.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReplaceGlobal

func ReplaceGlobal(t *Tunnel) func()

ReplaceGlobal replaces the global Tunnel, and returns a function to restore the original values. It's safe for concurrent use.

Types

type Tunnel

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

func New

func New(dialer proxy.Dialer, manager *statistic.Manager) *Tunnel

func T

func T() *Tunnel

T returns the global Tunnel, which can be reconfigured with ReplaceGlobal. It's safe for concurrent use.

func (*Tunnel) Close

func (t *Tunnel) Close()

Close closes the Tunnel and releases its resources.

func (*Tunnel) Dialer

func (t *Tunnel) Dialer() proxy.Dialer

func (*Tunnel) HandleTCP

func (t *Tunnel) HandleTCP(conn adapter.TCPConn)

func (*Tunnel) HandleUDP

func (t *Tunnel) HandleUDP(conn adapter.UDPConn)

func (*Tunnel) ProcessAsync

func (t *Tunnel) ProcessAsync()

ProcessAsync can be safely called multiple times, but will only be effective once.

func (*Tunnel) SetDialer

func (t *Tunnel) SetDialer(dialer proxy.Dialer)

func (*Tunnel) SetUDPTimeout

func (t *Tunnel) SetUDPTimeout(timeout time.Duration)

func (*Tunnel) TCPIn

func (t *Tunnel) TCPIn() chan<- adapter.TCPConn

TCPIn return fan-in TCP queue.

func (*Tunnel) UDPIn

func (t *Tunnel) UDPIn() chan<- adapter.UDPConn

UDPIn return fan-in UDP queue.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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