protected

package
v0.0.0-...-8b1022e Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package protected is used for creating "protected" connections that bypass Android's VpnService

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitHostPort

func SplitHostPort(addr string) (string, int, error)

SplitHostAndPort is a wrapper around net.SplitHostPort that also uses strconv to convert the port to an int

Types

type DnsResponse

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

func (*DnsResponse) PickRandomIP

func (response *DnsResponse) PickRandomIP() (net.IP, error)

PickRandomIP picks a random IP address from a DNS response

type Protect

type Protect func(fileDescriptor int) error

type ProtectedConn

type ProtectedConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*ProtectedConn) Close

func (conn *ProtectedConn) Close() (err error)

Close is used to destroy a protected connection

type Protector

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

func New

func New(protect Protect, dnsServer string) *Protector

func (*Protector) Dial

func (p *Protector) Dial(network, addr string, timeout time.Duration) (net.Conn, error)

Dial creates a new protected connection.

  • syscall API calls are used to create and bind to the specified system device (this is primarily used for Android VpnService routing functionality)

func (*Protector) Resolve

func (p *Protector) Resolve(network string, addr string) (*net.TCPAddr, error)

Resolve resolves the given address using a DNS lookup on a UDP socket protected by the given Protect function.

Jump to

Keyboard shortcuts

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