sysproxy

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: Apache-2.0, BSD-2-Clause-Views, BSD-3-Clause, + 4 more Imports: 11 Imported by: 0

Documentation

Overview

Package sysproxy implements Manager, providing a unified, cross-platform interface for configuring system proxies.

sysproxy uses PAC (Proxy Auto-Config) as the configuration method due to the extensive use of proxy exceptions. While declarative configuration methods also support exceptions, they often impose strict limits on the number of characters that can be specified. For example, the ProxyOverride registry key on Windows is limited to approximately 2000 characters, and the equivalent setting on macOS has a limit of around 650 characters. In contrast, PAC files can typically be up to 1MB in size, which is more than sufficient for our use case.

To discover more about PAC, see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_PAC_file

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedDesktopEnvironment = errors.New("system proxy configuration is currently only supported on GNOME")

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(pacPort int) *Manager

NewManager creates a new system proxy Manager. The PAC server will listen on the given pacPort. If pacPort is 0, a random port will be chosen.

func (*Manager) Clear

func (m *Manager) Clear() error

Clear removes the system proxy configuration.

func (*Manager) Set

func (m *Manager) Set(proxyPort int, userConfiguredExcludedHosts []string) error

Set configures the system proxy to use the proxy server listening on the given port.

Jump to

Keyboard shortcuts

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