mobile

package
v3.0.0-...-e766414 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Overview

Package mobile configures and instantiates a Martian Proxy. This package is a reference implementation of Martian Proxy intended to be cross compiled with gomobile for use on Android and iOS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogLevel

func SetLogLevel(l int)

SetLogLevel sets the Martian log level (Silent = 0, Error, Info, Debug), controlling which Martian log calls are displayed in the console

Types

type Martian

type Martian struct {
	HARLogging     bool
	TrafficPort    int
	TrafficShaping bool
	APIPort        int
	APIOverTLS     bool
	BindLocalhost  bool
	Cert           string
	Key            string
	AllowCORS      bool
	RoundTripper   *http.Transport
	// contains filtered or unexported fields
}

Martian is a wrapper for the initialized Martian proxy

func NewProxy

func NewProxy() *Martian

NewProxy creates a new Martian struct for configuring and starting a martian.

func (*Martian) EnableCybervillains

func (m *Martian) EnableCybervillains()

EnableCybervillains configures Martian to use the Cybervillians certificate.

func (*Martian) IsStarted

func (m *Martian) IsStarted() bool

IsStarted returns true if the proxy has finished starting.

func (*Martian) Shutdown

func (m *Martian) Shutdown()

Shutdown tells the Proxy to close. This function returns immediately, though there may still be connection threads hanging around until they time out depending on how the OS manages them.

func (*Martian) Start

func (m *Martian) Start()

Start starts the proxy given the configured values of the Martian struct.

Jump to

Keyboard shortcuts

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