tun

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAllRouteFailError

func IsAllRouteFailError(err error) bool

IsAllRouteFailError check the error type

Types

type AllRouteFailError

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

AllRouteFailError ...

func (AllRouteFailError) Error

func (e AllRouteFailError) Error() string

func (AllRouteFailError) OriginalError

func (e AllRouteFailError) OriginalError() error

type Cli

type Cli struct{}

Cli the singleton type

func (*Cli) CheckContext

func (s *Cli) CheckContext() error

CheckContext check everything needed for tun setup

func (*Cli) CheckRoute added in v0.3.5

func (s *Cli) CheckRoute(ipRange []string) []string

CheckRoute check whether all route rule setup properly

func (*Cli) GetName

func (s *Cli) GetName() string

func (*Cli) RestoreRoute added in v0.3.3

func (s *Cli) RestoreRoute() error

RestoreRoute delete route rules made by kt

func (*Cli) SetRoute

func (s *Cli) SetRoute(ipRange []string, excludeIpRange []string) error

SetRoute let specified ip range route to tun device

func (*Cli) ToSocks

func (s *Cli) ToSocks(sockAddr string) error

ToSocks create a tun and connect to socks endpoint

type Tunnel

type Tunnel interface {
	CheckContext() error
	ToSocks(sockAddr string) error
	SetRoute(ipRange []string, excludeIpRange []string) error
	CheckRoute(ipRange []string) []string
	RestoreRoute() error
	GetName() string
}

Tunnel ...

func Ins

func Ins() Tunnel

Ins get singleton instance

Jump to

Keyboard shortcuts

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