lantern

package
v0.0.0-...-fd97e0e Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package lantern provides an embeddable client-side web proxy

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLoggingMetadata

func AddLoggingMetadata(key, value string)

AddLoggingMetadata adds metadata for reporting to cloud logging services

func ProtectConnections

func ProtectConnections(dnsServer string, protector SocketProtector)

ProtectConnections allows connections made by Lantern to be protected from routing via a VPN. This is useful when running Lantern as a VPN on Android, because it keeps Lantern's own connections from being captured by the VPN and resulting in an infinite loop.

Types

type SocketProtector

type SocketProtector interface {
	Protect(fileDescriptor int) error
}

type StartResult

type StartResult struct {
	HTTPAddr   string
	SOCKS5Addr string
}

StartResult provides information about the started Lantern

func Start

func Start(configDir string, timeoutMillis int) (*StartResult, error)

Start starts a HTTP and SOCKS proxies at random addresses. It blocks up till the given timeout waiting for the proxy to listen, and returns the addresses at which it is listening (HTTP, SOCKS). If the proxy doesn't start within the given timeout, this method returns an error.

If a Lantern proxy is already running within this process, that proxy is reused.

Note - this does not wait for the entire initialization sequence to finish, just for the proxy to be listening. Once the proxy is listening, one can start to use it, even as it finishes its initialization sequence. However, initial activity may be slow, so clients with low read timeouts may time out.

Jump to

Keyboard shortcuts

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