Help us shape the future of Go! Take the 2026 Go Developer Survey

lantern

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: GPL-3.0 Imports: 12 Imported by: 0

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.

Jump to

Keyboard shortcuts

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