# Packages
No description provided by the author
No description provided by the author
Package server implements the core tunnel functionality of a Psiphon server.
Package transferstats counts and keeps track of session stats.
No description provided by the author
# Functions
ClearReportedPersistentStats deletes a list of persistent stat records that were successfully reported.
CloseDataStore closes the singleton data store instance, if open.
ConnectTunnel first makes a network transport connection to the Psiphon server and then establishes an SSH client session on top of that transport.
CountServerEntries returns a count of stored server entries.
CountServerEntriesWithConstraints returns a count of stored server entries for the specified region and tunnel protocol limits.
CountSLOKs returns the total number of SLOK records.
CountUnreportedPersistentStats returns the number of persistent stat records in StateUnreported.
CustomTLSDial is a customized replacement for tls.Dial.
No description provided by the author
DeleteDialParameters clears any dial parameters associated with the specified server/network ID.
DeleteSLOKs deletes all SLOK records.
DialMeek returns an initialized meek connection.
DialTCP creates a new, connected TCPConn.
No description provided by the author
DownloadUpgrade performs a resumable download of client upgrade files.
FetchCommonRemoteServerList downloads the common remote server list from config.RemoteServerListURLs.
FetchObfuscatedServerLists downloads the obfuscated remote server lists from config.ObfuscatedServerListRootURLs.
FilterUrlError transforms an error, when it is a url.Error, removing the URL value.
GetDialParameters fetches any dial parameters associated with the specified server/network ID.
GetEmitDiagnoticNotices returns the current state of emitting diagnostic notices.
GetKeyValue retrieves the value for a given key.
GetNotice receives a JSON encoded object and attempts to parse it as a Notice.
GetSLOK returns a SLOK key for the specified ID.
GetSplitTunnelRoutesData retrieves the cached routes data for the specified region.
GetSplitTunnelRoutesETag retrieves the etag for cached routes data for the specified region.
GetTacticsStorer creates a TacticsStorer.
GetUrlETag retrieves a previously stored an ETag for the specfied URL.
No description provided by the author
No description provided by the author
IsAddressInUseError returns true when the err is due to EADDRINUSE/WSAEADDRINUSE.
No description provided by the author
LoadConfig parses a JSON format Psiphon config JSON string and returns a Config struct populated with config values.
LocalProxyRelay sends to remoteConn bytes received from localConn, and sends to localConn bytes received from remoteConn.
LookupIP resolves a hostname.
MakeCompatibleServerEntry provides backwards compatibility with old server entries which have a single meekFrontingDomain and not a meekFrontingAddresses array.
MakeDialParameters creates a new DialParameters for the candidate server entry, including selecting a protocol and all the various protocol attributes.
MakeDownloadHTTPClient is a helper that sets up a http.Client for use either untunneled or through a tunnel.
MakePsiphonUserAgent constructs a User-Agent value to use for web service requests made by the tunnel-core client.
MakeSessionId creates a new session ID.
MakeTunneledHTTPClient returns a net/http.Client which is configured to use custom dialing features including tunneled dialing and, optionally, UseTrustedCACertificatesForStockTLS.
MakeUntunneledHTTPClient returns a net/http.Client which is configured to use custom dialing features -- including BindToDevice, etc.
NewController initializes a new controller.
NewCustomTLSDialer creates a new dialer based on CustomTLSDial.
NewHttpProxy initializes and runs a new HTTP proxy server.
NewNetDialer creates a new NetDialer.
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.
NewNoticeWriter initializes a new NoticeWriter.
NewPacketTunnelTransport initializes a PacketTunnelTransport.
No description provided by the author
NewServerContext makes the tunneled handshake request to the Psiphon server and returns a ServerContext struct for use with subsequent Psiphon server API requests (e.g., periodic connected and status requests).
NewServerEntryIterator creates a new ServerEntryIterator.
NewSocksProxy initializes a new SOCKS server.
No description provided by the author
NewSyncFileWriter creates a SyncFileWriter.
No description provided by the author
NewTCPDialer creates a TCP Dialer.
NewUDPConn resolves addr and configures a new UDP conn.
NoticeActiveAuthorizationIDs reports the authorizations the server has accepted.
NoticeActiveTunnel is a successful connection that is used as an active tunnel for port forwarding.
NoticeAlert is an alert message; typically a recoverable error condition.
NoticeAvailableEgressRegions is what regions are available for egress from.
No description provided by the author
NoticeBuildInfo reports build version info.
NoticeBytesTransferred reports how many tunneled bytes have been transferred since the last NoticeBytesTransferred, for the tunnel to the server at ipAddress.
NoticeCandidateServers is how many possible servers are available for the selected region and protocols.
NoticeClientIsLatestVersion reports that an upgrade check was made and the client is already the latest version.
NoticeClientRegion is the client's region, as determined by the server and reported to the client in the handshake.
NoticeClientUpgradeAvailable is an available client upgrade, as per the handshake.
NoticeClientUpgradeDownloaded indicates that a client upgrade download is complete and available at the destination specified.
NoticeClientUpgradeDownloadedBytes reports client upgrade download progress.
NoticeCommonLogger maps the common.Logger interface to the notice facility.
NoticeConnectedServer reports parameters and details for a single successful connection.
NoticeConnectingServer reports parameters and details for a single connection attempt.
NoticeError is an error message; typically an unrecoverable error condition.
NoticeEstablishTunnelTimeout reports that the configured EstablishTunnelTimeout duration was exceeded.
NoticeExiting indicates that tunnel-core is exiting imminently.
NoticeHomepages emits a series of NoticeHomepage, the sponsor homepages.
NoticeHttpProxyPortInUse is a failure to use the configured LocalHttpProxyPort.
NoticeInfo is an informational message.
NoticeListeningHttpProxyPort is the selected port for the listening local HTTP proxy.
NoticeListeningSocksProxyPort is the selected port for the listening local SOCKS proxy.
No description provided by the author
NoticeLocalProxyError reports a local proxy error message.
No description provided by the author
NoticeRemoteServerListResourceDownloaded indicates that a remote server list download completed successfully.
NoticeRemoteServerListResourceDownloadedBytes reports remote server list download progress.
NoticeRequestedTactics reports parameters and details for a successful tactics request.
NoticeRequestingTactics reports parameters and details for a tactics request attempt.
NoticeServerTimestamp reports server side timestamp as seen in the handshake.
NoticeSessionId is the session ID used across all tunnels established by the controller.
NoticeSLOKSeeded indicates that the SLOK with the specified ID was received from the Psiphon server.
NoticeSocksProxyPortInUse is a failure to use the configured LocalSocksProxyPort.
NoticeSplitTunnelRegion reports that split tunnel is on for the given region.
NoticeTotalBytesTransferred reports how many tunneled bytes have been transferred in total up to this point, for the tunnel to the server at ipAddress.
NoticeTunnels is how many active tunnels are available.
NoticeUntunneled indicates than an address has been classified as untunneled and is being accessed directly.
NoticeUpstreamProxyError reports an error when connecting to an upstream proxy.
NoticeUserLog is a log message from the outer client user of tunnel-core.
OpenDataStore opens and initializes the singleton data store instance.
PickUserAgentIfUnset selects a User-Agent header if one is not set.
PromoteServerEntry sets the server affinity server entry ID to the specified server entry IP address.
PutBackUnreportedPersistentStats restores a list of persistent stat records to StateUnreported.
RecordRemoteServerListStat records a completed common or OSL remote server list resource download.
No description provided by the author
No description provided by the author
ReportAvailableRegions prints a notice with the available egress regions.
ResetRepetitiveNotices resets the repetitive notice state, so the next instance of any notice will not be supressed.
ResolveIP uses a custom dns stack to make a DNS query over the given TCP or UDP conn.
ResumeDownload is a reusable helper that downloads requestUrl via the httpClient, storing the result in downloadFilename when the download is complete.
SelectTLSProfile picks a random TLS profile from the available candidates.
Encrypt feedback and upload to server.
SetDialParameters stores dial parameters associated with the specified server/network ID.
SetEmitDiagnosticNotices toggles whether diagnostic notices are emitted.
SetKeyValue stores a key/value pair.
SetNoticeFiles configures files for notice writing.
SetNoticeWriter sets a target writer to receive notices.
SetSLOK stores a SLOK key, referenced by its ID.
SetSplitTunnelRoutes updates the cached routes data for the given region.
SetUrlETag stores an ETag for the specfied URL.
StorePersistentStat adds a new persistent stat record, which is set to StateUnreported and is an immediate candidate for reporting.
StoreServerEntries stores a list of server entries.
StoreServerEntry adds the server entry to the data store.
StreamingStoreServerEntries stores a list of server entries.
TakeOutUnreportedPersistentStats returns up to maxCount persistent stats records that are in StateUnreported.
TrimError removes the middle of over-long error message strings.
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
# Structs
Config is the Psiphon configuration specified by the application.
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, UDPDial, MeekDial, etc.).
DialParameters represents a selected protocol and all the related selected protocol attributes, many chosen at random, for a tunnel dial attempt.
HttpProxy is a HTTP server that relays HTTP requests through the Psiphon tunnel.
MeekConfig specifies the behavior of a MeekConn.
MeekConn is a network connection that tunnels TCP over HTTP and supports "fronting".
NetDialer implements an interface that matches net.Dialer.
NoticeReceiver consumes a notice input stream and invokes a callback function for each discrete JSON notice object byte sequence.
NoticeWriter implements io.Writer and emits the contents of Write() calls as Notices.
PacketTunnelTransport is an integration layer that presents an io.ReadWriteCloser interface to a tun.Client as the transport for relaying packets.
ServerContext is a utility struct which holds all of the data associated with a Psiphon server connection.
ServerEntryIterator is used to iterate over stored server entries in rank order.
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.
SplitTunnelClassifier determines whether a network destination should be accessed through a tunnel or accessed directly.
SyncFileWriter wraps a file and exposes an io.Writer.
TacticsStorer implements tactics.Storer.
TCPConn is a customized TCP connection that supports the Closer interface and which may be created using options in DialConfig, including UpstreamProxyURL, DeviceBinder, IPv6Synthesizer, and ResolvedIPCallback.
Tunnel is a connection to a Psiphon server.
TunneledConn implements net.Conn and wraps a port forward connection.
# Interfaces
DeviceBinder defines the interface to the external BindToDevice provider which calls into the host application to bind sockets to specific devices.
DnsServerGetter defines the interface to the external GetDnsServer provider which calls into the host application to discover the native network DNS server settings.
IPv6Synthesizer defines the interface to the external IPv6Synthesize provider which calls into the host application to synthesize IPv6 addresses from IPv4 ones.
NetworkConnectivityChecker defines the interface to the external HasNetworkConnectivity provider, which call into the host application to check for network connectivity.
NetworkIDGetter defines the interface to the external GetNetworkID provider, which returns an identifier for the host's current active network.
Tunneler specifies the interface required by components that use a tunnel.
TunnelOwner specifies the interface required by Tunnel to notify its owner when it has failed.
# Type aliases
Dialer is a custom network dialer.
No description provided by the author