Documentation
¶
Overview ¶
package lantern provides an API for interacting with the flashlight library. It is designed to act as a mobile SDK for integrating Lantern's proxying and censorship circumvention capabilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LanternClient ¶
type LanternClient struct {
// contains filtered or unexported fields
}
LanternClient provides an interface for configuring and running Lantern's HTTP proxy. Each instance manages its own configuration and state
func NewLanternClient ¶
func NewLanternClient() *LanternClient
NewLanternClient initializes a new Lantern client instance.
func (*LanternClient) HTTPProxyPort ¶
func (lc *LanternClient) HTTPProxyPort() (int, error)
HTTPProxyPort returns the port the HTTP proxy is listening on
func (*LanternClient) IsRunning ¶
func (lc *LanternClient) IsRunning() bool
IsRunning returns whether or not Lantern is currently running
func (*LanternClient) Setup ¶
func (lc *LanternClient) Setup(appName, configDir string)
Setup configures the Lantern SDK by setting the application name and configuration directory. This method must be called before starting Lantern.
func (*LanternClient) Start ¶
func (lc *LanternClient) Start(httpProxyAddr string, proxyAll bool) (*StartResult, error)
Start initializes and starts the Lantern HTTP proxy. If Lantern is already running, this method returns an error. It blocks until the proxy is ready
func (*LanternClient) Stop ¶
func (lc *LanternClient) Stop() error
Stop disables Lantern's proxy functionality but allows it to continue running in the background for configuration updates.
type StartResult ¶
type StartResult struct {
Addr string
}
StartResult provides information about the started Lantern instance, including the address where the HTTP proxy is listening.