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 StartResult ¶
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.