sockets

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package sockets provides helper functions to create and configure Unix or TCP sockets.

Index

Constants

This section is empty.

Variables

View Source
var ErrProtocolNotAvailable = errors.New("protocol not available")

ErrProtocolNotAvailable is returned when a given transport protocol is not provided by the operating system.

Functions

func ConfigureTransport

func ConfigureTransport(tr *http.Transport, proto, addr string) error

ConfigureTransport configures the specified Transport according to the specified proto and addr. If the proto is unix (using a unix socket to communicate) or npipe the compression is disabled.

func DialPipe

func DialPipe(_ string, _ time.Duration) (net.Conn, error)

DialPipe connects to a Windows named pipe. This is not supported on other OSes.

func DialerFromEnvironment

func DialerFromEnvironment(direct *net.Dialer) (proxy.Dialer, error)

DialerFromEnvironment takes in a "direct" *net.Dialer and returns a proxy.Dialer which will route the connections through the proxy using the given dialer.

func GetProxyEnv

func GetProxyEnv(key string) string

GetProxyEnv allows access to the uppercase and the lowercase forms of proxy-related variables. See the Go specification for details on these variables. https://golang.org/pkg/net/http/

Types

This section is empty.

Jump to

Keyboard shortcuts

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