protect

package
v0.0.0-...-4cf4c4f Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeDialer

func MakeDialer(p Protector) *net.Dialer

MakeDialer creates a new Dialer. Recipients can safely mutate any public field except Control and Resolver, which are both populated.

func MakeListenConfig

func MakeListenConfig(p Protector) *net.ListenConfig

MakeListenConfig returns a new ListenConfig that creates protected listener sockets.

Types

type Protector

type Protector interface {
	// Protect a socket, i.e. exclude it from the VPN.
	// This is needed in order to avoid routing loops for the VPN's own sockets.
	// This is a wrapper for Android's VpnService.protect().
	Protect(socket int32) bool

	// Returns a comma-separated list of the system's configured DNS resolvers,
	// in roughly descending priority order.
	// This is needed because (1) Android Java cannot protect DNS lookups but Go can, and
	// (2) Android Java can determine the list of system DNS resolvers but Go cannot.
	// A comma-separated list is used because Gomobile cannot bind []string.
	GetResolvers() string
}

Protector provides the ability to bypass a VPN on Android, pre-Lollipop.

Jump to

Keyboard shortcuts

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