lantern

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 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 FeedByName

func FeedByName(name string, retriever FeedRetriever)

FeedByName grabs the feed results for a given feed source name

func GetFeed

func GetFeed(locale string, allStr string, proxyAddr string, provider FeedProvider)

GetFeed fetches the public feed thats displayed on Lantern's main screen

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.

func RemoveOverrides

func RemoveOverrides()

RemoveOverrides removes the protected tlsdialer overrides that allowed connections to bypass the VPN.

Types

type FeedProvider

type FeedProvider interface {
	AddSource(string)
}

type FeedRetriever

type FeedRetriever interface {
	AddFeed(string, string, string, string)
}

type SocketProtector

type SocketProtector interface {
	Protect(fileDescriptor int) error
}

SocketProtector is an interface for classes that can protect Android sockets, meaning those sockets will not be passed through the VPN.

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