Documentation ¶
Overview ¶
Package lantern provides an embeddable client-side web proxy
Index ¶
- func AddLoggingMetadata(key, value string)
- func FeedByName(name string, retriever FeedRetriever)
- func GetFeed(locale string, allStr string, proxyAddr string, provider FeedProvider)
- func ProtectConnections(dnsServer string, protector SocketProtector)
- func RemoveOverrides()
- type FeedProvider
- type FeedRetriever
- type SocketProtector
- type StartResult
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 SocketProtector ¶
SocketProtector is an interface for classes that can protect Android sockets, meaning those sockets will not be passed through the VPN.
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.