Documentation
¶
Overview ¶
Package sysproxy finds the HTTP proxy a connection has to go through, for the one thing RemoHop sends over HTTP: the websocket bridge to the rendezvous server (internal/wsdgram), which is the way out of a network that allows nothing else.
In the order they are asked:
- the environment: HTTPS_PROXY, HTTP_PROXY and NO_PROXY, in either case, as every command-line tool reads them. If any of them is set, the environment decides, including "no proxy";
- the `proxy` setting: a proxy URL, or off. It is for machines whose programs are not started from a shell (the desktop app, a service), and for the proxy's user and password where it wants them;
- the system's own settings, where the people who run an office network put the proxy: on Windows the Internet Options of the current user, on macOS the network service's proxies.
A proxy auto-config script (PAC) in the system's settings is reported, not evaluated: Describe names it, so that doctor can say that the proxy it would pick has to be set by hand.
Index ¶
Constants ¶
const ( FromEnvironment = "environment" FromSetting = "setting" FromSystem = "system" )
Where a proxy comes from (Info.Source).
const SettingProxy = "proxy"
SettingProxy is the config key of the proxy setting.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Info ¶
type Info struct {
// Proxy is the proxy, without credentials; empty for a direct
// connection. HasCredentials says a user name came with it.
Proxy string
HasCredentials bool
// Source is where the answer comes from: FromEnvironment, FromSetting
// or FromSystem.
Source string
// PAC is the system's proxy auto-config script and AutoDetect its
// "detect settings automatically", when the system's settings were
// what was asked and they name no proxy for u: the script might, and
// it is not evaluated.
PAC string
AutoDetect bool
// Error is why the proxy could not be determined.
Error string
}
Info describes how u would be reached, for diagnosis.
type System ¶
type System struct {
// HTTPS is the proxy for HTTPS requests, HOST:PORT or a URL; empty
// for none.
HTTPS string
// Bypass lists hosts that are reached directly: names, patterns with
// * (*.corp.example), and <local> for names without a dot.
Bypass []string
// PAC is the URL of a proxy auto-config script, AutoDetect whether
// the system is set to look for one (WPAD). Neither is followed.
PAC string
AutoDetect bool
}
System is what the operating system's proxy settings say.