ipn

package
v0.0.0-...-5849f3d Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MPL-2.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Block   = x.Block
	Base    = x.Base
	Exit    = x.Exit
	OrbotS5 = x.OrbotS5
	OrbotH1 = x.OrbotH1

	SOCKS5   = x.SOCKS5
	HTTP1    = x.HTTP1
	WG       = x.WG
	PIPH2    = x.PIPH2
	PIPWS    = x.PIPWS
	NOOP     = x.NOOP
	INTERNET = x.INTERNET

	TZZ = x.TZZ
	TUP = x.TUP
	TOK = x.TOK
	TKO = x.TKO
	END = x.END

	NOMTU  = 0
	MAXMTU = 65535
)
View Source
const (
	FAST = x.WGFAST
)

Variables

View Source
var PROXYGATEWAY = &gw{ok: true}

PROXYGATEWAY is a Router that routes everything.

View Source
var PROXYNOGATEWAY = &gw{ok: false}

PROXYNOGATEWAY is a Router that routes nothing.

Functions

func Fetch

func Fetch(p Proxy, req *http.Request) (*http.Response, error)

func SetReadDeadline

func SetReadDeadline(t time.Time) error

func SetWriteDeadline

func SetWriteDeadline(t time.Time) error

Types

type PingAddr

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

func PingAddrFromAddr

func PingAddrFromAddr(addr netip.Addr) *PingAddr

func (PingAddr) Addr

func (ipp PingAddr) Addr() netip.Addr

func (PingAddr) Network

func (ipp PingAddr) Network() string

func (PingAddr) String

func (ipp PingAddr) String() string

type PingConn

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

func (*PingConn) Close

func (pc *PingConn) Close() error

func (*PingConn) LocalAddr

func (pc *PingConn) LocalAddr() net.Addr

func (*PingConn) Read

func (pc *PingConn) Read(p []byte) (n int, err error)

func (*PingConn) ReadFrom

func (pc *PingConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)

func (*PingConn) RemoteAddr

func (pc *PingConn) RemoteAddr() net.Addr

func (*PingConn) SetDeadline

func (pc *PingConn) SetDeadline(t time.Time) error

func (*PingConn) SetReadDeadline

func (pc *PingConn) SetReadDeadline(t time.Time) error

func (*PingConn) SetWriteDeadline

func (pc *PingConn) SetWriteDeadline(t time.Time) error

func (*PingConn) Write

func (pc *PingConn) Write(p []byte) (n int, err error)

func (*PingConn) WriteTo

func (pc *PingConn) WriteTo(p []byte, addr net.Addr) (n int, err error)

type Proxies

type Proxies interface {
	x.Proxies
	// Get returns a transport from this multi-transport.
	ProxyFor(id string) (Proxy, error)
}

func NewProxifier

func NewProxifier(c protect.Controller, o x.ProxyListener) Proxies

type Proxy

type Proxy interface {
	x.Proxy
	// Dial returns a connection to this proxy.
	Dial(network, addr string) (protect.Conn, error)
	// Announce returns a packet-oriented udp connection on this proxy.
	Announce(network, local string) (protect.PacketConn, error)
	// Accept returns a listener for this proxy.
	Accept(network, local string) (protect.Listener, error)

	// Dialer returns the dialer for this proxy, which is an
	// adapter for protect.RDialer interface, but with the caveat that
	// not all Proxy instances implement DialTCP and DialUDP, though are
	// guaranteed to implement Dial.
	Dialer() *protect.RDial
	// contains filtered or unexported methods
}

func NewBaseProxy

func NewBaseProxy(c protect.Controller) Proxy

func NewExitProxy

func NewExitProxy(c protect.Controller) Proxy

func NewGroundProxy

func NewGroundProxy() Proxy

func NewHTTPProxy

func NewHTTPProxy(id string, c protect.Controller, po *settings.ProxyOptions) (Proxy, error)

func NewPipProxy

func NewPipProxy(id string, ctl protect.Controller, po *settings.ProxyOptions) (Proxy, error)

func NewPipWsProxy

func NewPipWsProxy(id string, ctl protect.Controller, po *settings.ProxyOptions) (Proxy, error)

func NewSocks5Proxy

func NewSocks5Proxy(id string, ctl protect.Controller, po *settings.ProxyOptions) (Proxy, error)

type WgProxy

type WgProxy interface {
	Proxy
	tun.Device

	IpcSet(txt string) error
	// contains filtered or unexported methods
}

func NewWgProxy

func NewWgProxy(id string, ctl protect.Controller, cfg string) (WgProxy, error)

ref: github.com/WireGuard/wireguard-android/blob/713947e432/tunnel/tools/libwg-go/api-android.go#L76

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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