router

package
v0.0.0-...-365054f Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean() error

Clean removes all previously added routing rules.

func ExcludeIP

func ExcludeIP(ip net.IP) error

ExcludeIP adds IP based exception to route traffic directly.

func ExcludeURL

func ExcludeURL(urls ...string) error

ExcludeURL adds exception to route traffic directly for specified URL (host part is usually taken).

func NewManager

func NewManager() *manager

NewManager creates a new instance of service that maintain routing table to match current state.

func Protect

func Protect(fd int) error

Protect protects provided connection from going through the tunnel.

func ProtectUDPConn

func ProtectUDPConn(c *net.UDPConn) error

ProtectUDPConn protects provided UDP connection from going through the tunnel.

func RemoveExcludedIP

func RemoveExcludedIP(ip net.IP) error

RemoveExcludedIP removes IP based exception to route traffic directly.

func RemoveExcludedURL

func RemoveExcludedURL(urls ...string) error

RemoveExcludedURL removes exception to route traffic directly for specified URL (host part is usually taken).

func SetProtectFunc

func SetProtectFunc(f func(fd int) error)

SetProtectFunc sets the callback for using to protect provided connection from going through the tunnel.

Types

type Manager

type Manager interface {
	ExcludeIP(net.IP) error
	RemoveExcludedIP(net.IP) error
	Clean() error
}

Manager describes a routing tables management service.

var (
	// DefaultRouter contains a default router used for managing routing tables.
	DefaultRouter Manager
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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