# Packages
Package stats counts and keeps track of session stats.
# Functions
Contains is a helper function that returns true if the target string is in the list.
ContextError prefixes an error message with the current function name.
CountServerEntries returns a count of stored servers for the specified region and protocol.
CustomTLSDialWithDialer is a customized replacement for tls.Dial.
DecodeAndValidateServerEntryList extracts server entries from the list encoding used by remote server lists and Psiphon server handshake requests.
No description provided by the author
DecodeServerEntry extracts server entries from the encoding used by remote server lists and Psiphon server handshake requests.
DialMeek returns an initialized meek connection.
TCPConn creates a new, connected TCPConn.
EstablishTunnel first makes a network transport connection to the Psiphon server and then establishes an SSH client session on top of that transport.
FetchRemoteServerList downloads a remote server list JSON record from config.RemoteServerListUrl; validates its digital signature using the public key config.RemoteServerListSignaturePublicKey; and parses the data field into ServerEntry records.
GetKeyValue retrieves the value for a given key.
GetNoticeTunnels receives a JSON encoded object and attempts to parse it as a Notice.
GetServerEntryIpAddresses returns an array containing all stored server IP addresses.
HttpProxyConnect establishes a HTTP CONNECT tunnel to addr through an established network connection to an HTTP proxy.
InitDataStore initializes the singleton instance of dataStore.
IsAddressInUseError returns true when the err is due to EADDRINUSE/WSAEADDRINUSE.
LoadConfig parses and validates a JSON format Psiphon config JSON string and returns a Config struct populated with config values.
LookupIP resolves a hostname.
MakeRandomPeriod returns a random duration, within a given range.
MakeSecureRandomBytes is a helper function that wraps crypto/rand.Read.
MakeSecureRandomInt is a helper function that wraps MakeSecureRandomInt64.
MakeSecureRandomInt64 is a helper function that wraps crypto/rand.Int, which returns a uniform random value in [0, max).
MakeSecureRandomPadding selects a random padding length in the indicated range and returns a random byte array of the selected length.
MakeSessionId creates a new session ID.
NewController initializes a new controller.
No description provided by the author
NewHttpProxy initializes and runs a new HTTP proxy server.
NewNoticeConsoleRewriter consumes JSON-format notice input and parses each notice and rewrites in a more human-readable format more suitable for console output.
NewNoticeReceiver initializes a new NoticeReceiver.
NewObfuscatedSshConn creates a new ObfuscatedSshConn.
NewObfuscator creates a new Obfuscator, initializes it with a seed message, derives client and server keys, and creates RC4 stream ciphers to obfuscate data.
NewServerEntryIterator creates a new NewServerEntryIterator.
NewSession makes the tunnelled handshake request to the Psiphon server and returns a Session struct, initialized with the session ID, for use with subsequent Psiphon server API requests (e.g., periodic connected and status requests).
NewSocksProxy initializes a new SOCKS server.
NewTCPDialer creates a TCPDialer.
NoticeActiveTunnel is a successful connection that is used as an active tunnel for port forwarding.
NoticeInfo is an alert message; typically a recoverable error condition.
No description provided by the author
NoticeCandidateServers is how many possible servers are available for the selected region and protocol.
NoticeClientUpgradeAvailable is an available client upgrade, as per the handshake.
NoticeConnectingServer is details on a connection attempt.
NoticeCoreVersion is the version string of the core.
NoticeInfo is an error message; typically an unrecoverable error condition.
NoticeClientUpgradeAvailable is a sponsor homepage, as per the handshake.
NoticeSocksProxyPortInUse is a failure to use the configured LocalHttpProxyPort.
NoticeInfo is an informational message.
NoticeListeningSocksProxyPort is the selected port for the listening local HTTP proxy.
NoticeListeningSocksProxyPort is the selected port for the listening local SOCKS proxy.
NoticeSocksProxyPortInUse is a failure to use the configured LocalSocksProxyPort.
NoticeTunnels is how many active tunnels are available.
PromoteServerEntry assigns the top rank (one more than current max rank) to the specified server entry.
Relay sends to remoteConn bytes received from localConn, and sends to localConn bytes received from remoteConn.
SetKeyValue stores a key/value pair.
SetNoticeOutput sets a target writer to receive notices.
StoreServerEntries shuffles and stores a list of server entries.
StoreServerEntry adds the server entry to the data store.
TrimError removes the middle of over-long error message strings.
ValidateServerEntry checks for malformed server entries.
WaitForNetworkConnectivity uses a NetworkConnectivityChecker to periodically check for network connectivity.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
OpenSSH max packet length.
RFC 4253 sec.
No description provided by the author
No description provided by the author
uint32 + byte.
Default cipher block size.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
This is a list of supported tunnel protocols, in default preference order.
# Structs
No description provided by the author
Conns is a synchronized list of Conns that is used to coordinate interrupting a set of goroutines establishing connections, or close a set of open connections, etc.
Controller is a tunnel lifecycle coordinator.
CustomTLSConfig contains parameters to determine the behavior of CustomTLSDial.
DialConfig contains parameters to determine the behavior of a Psiphon dialer (TCPDial, MeekDial, etc.).
No description provided by the author
HttpProxy is a HTTP server that relays HTTP requests through the tunnel SSH client.
MeekConn is a network connection that tunnels TCP over HTTP and supports "fronting".
NoticeReceiver consumes a notice input stream and invokes a callback function for each discrete JSON notice object byte sequence.
ObfuscatedSshConn wraps a Conn and applies the obfuscated SSH protocol to the traffic on the connection: https://github.com/brl/obfuscated-openssh/blob/master/README.obfuscation ObfuscatedSshConn is used to add obfuscation to go's stock ssh client without modification to that standard library code.
Obfuscator implements the seed message, key derivation, and stream ciphers for: https://github.com/brl/obfuscated-openssh/blob/master/README.obfuscation.
No description provided by the author
RemoteServerList is a JSON record containing a list of Psiphon server entries.
ServerEntry represents a Psiphon server.
ServerEntryIterator is used to iterate over stored server entries in rank order.
Session is a utility struct which holds all of the data associated with a Psiphon session.
SocksProxy is a SOCKS server that accepts local host connections and, for each connection, establishes a port forward through the tunnel SSH client and relays traffic through the port forward.
TCPConn is a customized TCP connection that: - can be interrupted while connecting; - implements idle read/write timeouts; - can be bound to a specific system device (for Android VpnService routing compatibility, for example).
Tunnel is a connection to a Psiphon server.
TunneledConn implements net.Conn and wraps a port foward connection.
# Interfaces
Conn is a net.Conn which supports sending a signal to a channel when it is closed.
DeviceBinder defines the interface to the external BindToDevice provider.
NetworkConnectivityChecker defines the interface to the external HasNetworkConnectivity provider.
Tunneler specifies the interface required by components that use a tunnel.
TunnerOwner specifies the interface required by Tunnel to notify its owner when it has failed.
# Type aliases
Dialer is a custom dialer compatible with http.Transport.Dial.
No description provided by the author
No description provided by the author