Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/docker/go-connections
/ functions
Functions
176 in github.com/docker/go-connections
⨍
Functions
176
◇
Types & classes
25
↓ 23 callers
Method
Close
Close stops forwarding traffic and close both ends of the Proxy.
proxy/proxy.go:19
↓ 14 callers
Function
getCertAndKey
returns the names of pre-generated key and certificate files.
tlsconfig/config_test.go:29
↓ 11 callers
Function
Client
Client returns a TLS configuration meant to be used by a client.
tlsconfig/config.go:208
↓ 11 callers
Method
Run
Run starts forwarding traffic back and forth between the front and back-end addresses.
proxy/proxy.go:17
↓ 10 callers
Method
Close
()
proxy/network_proxy_test.go:21
↓ 10 callers
Function
tempSocketPath
tempSocketPath returns a temporary socket path short enough to avoid exceeding Unix-domain socket path length limits on some platforms.
sockets/unix_socket_test.go:16
↓ 9 callers
Function
NewUnixSocketWithOpts
NewUnixSocketWithOpts creates a Unix socket with the specified options. On Unix platforms, socket permissions are 0000 by default, i.e. no access for
sockets/unix_socket.go:81
↓ 9 callers
Function
ParsePortSpecs
ParsePortSpecs receives port specs in the format of ip:public:private/proto and parses these in to the internal types
nat/nat.go:124
↓ 8 callers
Method
Proto
Proto returns the protocol of a Port
nat/nat.go:63
↓ 8 callers
Function
Server
Server returns a TLS configuration meant to be used by a server.
tlsconfig/config.go:233
↓ 7 callers
Method
LocalAddr
()
proxy/network_proxy_test.go:22
↓ 7 callers
Method
Port
Port returns the port number of a Port
nat/nat.go:72
↓ 7 callers
Method
Run
()
proxy/network_proxy_test.go:20
↓ 6 callers
Function
NewEchoServer
(t *testing.T, proto, address string)
proxy/network_proxy_test.go:35
↓ 6 callers
Function
NewProxy
NewProxy creates a Proxy according to the specified frontendAddr and backendAddr.
proxy/proxy.go:27
↓ 6 callers
Function
parsePortRange
parsePortRange parses and validates the specified string as a port range (e.g., "8000-9000").
nat/parse.go:17
↓ 5 callers
Method
Int
Int returns the port number of a Port as an int. It assumes [Port] is valid, and returns 0 otherwise.
nat/nat.go:79
↓ 5 callers
Function
ParsePortSpec
ParsePortSpec parses a port specification string into a slice of PortMappings
nat/nat.go:173
↓ 5 callers
Function
getMultiCert
returns the name of a pre-generated, multiple-certificate CA file with both RSA and ECDSA certs.
tlsconfig/config_test.go:24
↓ 5 callers
Function
runTest
(t *testing.T, path string, l net.Listener, echoStr string)
sockets/unix_socket_test.go:37
↓ 4 callers
Method
Accept
Accept implements the Accept method in the Listener interface; it waits for the next call and returns a generic Conn. It returns a [net.ErrClosed] if
sockets/inmem_socket.go:47
↓ 4 callers
Method
Dial
Dial establishes a connection with the in-memory listener. The network and addr parameters are accepted for compatibility with conventional dialer AP
sockets/inmem_socket.go:75
↓ 4 callers
Function
SplitProtoPort
SplitProtoPort splits a port(range) and protocol, formatted as "<portnum>/[<proto>]" "<startport-endport>/[<proto>]". It returns an empty string for b
nat/nat.go:101
↓ 4 callers
Function
defaultConfig
defaultConfig is the default config used by both client and server TLS configuration.
tlsconfig/config.go:68
↓ 4 callers
Function
parsePortNumber
parsePortNumber parses rawPort into an int, unwrapping strconv errors and returning a single "out of range" error for any value outside 0–65535.
nat/parse.go:43
↓ 4 callers
Function
testProxy
(t *testing.T, proto string, proxy Proxy)
proxy/network_proxy_test.go:116
↓ 3 callers
Function
NewUnixSocket
NewUnixSocket creates a Unix socket with the specified path and group. On Unix platforms, the socket is owned by root:gid and has permissions 0660.
sockets/unix_socket_unix.go:69
↓ 3 callers
Method
Printf
(format string, args ...any)
proxy/logger.go:4
↓ 3 callers
Method
String
()
nat/nat.go:152
↓ 3 callers
Function
WithChmod
WithChmod modifies socket file's access mode. Abstract Unix sockets have no filesystem representation, so this option returns an error wrapping [erro
sockets/unix_socket_unix.go:47
↓ 3 callers
Function
WithChown
WithChown modifies the socket file's uid and gid. Abstract Unix sockets have no filesystem representation, so this option returns an error wrapping [
sockets/unix_socket_unix.go:26
↓ 3 callers
Function
isAbstractSocket
isAbstractSocket reports whether path is an abstract Unix socket address. Go recognizes two representations of abstract socket addresses: - On Linux
sockets/unix_socket.go:113
↓ 3 callers
Function
newTestTrustRoot
()
tlsconfig/systempool_test.go:34
↓ 2 callers
Method
Addr
Addr returns the socket's addr string to satisfy net.Listener
sockets/inmem_socket.go:40
↓ 2 callers
Method
DialContext
DialContext establishes a connection with the in-memory listener. The network and addr parameters are accepted for compatibility with conventional di
sockets/inmem_socket.go:87
↓ 2 callers
Method
FrontendAddr
FrontendAddr returns the address on which the proxy is listening.
proxy/proxy.go:21
↓ 2 callers
Function
Sort
Sort sorts a list of ports using the provided predicate This function should compare `i` and `j`, returning true if `i` is considered to be less than
nat/sort.go:31
↓ 2 callers
Function
SortPortMap
SortPortMap sorts the list of ports and their respected mapping. The ports will explicit HostPort will be placed first.
nat/sort.go:66
↓ 2 callers
Function
WithAdditionalUsersAndGroups
WithAdditionalUsersAndGroups modifies the socket file's DACL to grant access to additional users and groups. It sets [BasePermissions] on the socket
sockets/unix_socket_windows.go:44
↓ 2 callers
Function
WithBasePermissions
WithBasePermissions sets a default DACL, which allows Administrators and LocalSystem full access (similar to defaults used in [moby]); - D:P: DACL wi
sockets/unix_socket_windows.go:33
↓ 2 callers
Function
adjustMinVersion
adjustMinVersion sets the MinVersion on `config`, the input configuration. It assumes the current MinVersion on the `config` is the lowest allowed.
tlsconfig/config.go:131
↓ 2 callers
Function
certPool
certPool returns an X.509 certificate pool from `caFile`, the certificate file.
tlsconfig/config.go:83
↓ 2 callers
Function
fakeSystemCertPool
()
tlsconfig/systempool_test.go:138
↓ 2 callers
Function
generateCertificate
(signer crypto.Signer, out io.Writer, isCA bool)
tlsconfig/fixtures/generate.go:36
↓ 2 callers
Function
getSecurityDescriptor
getSecurityDescriptor returns the DACL for the Unix socket. By default, it grants [BasePermissions]. Additional users and groups are granted generic
sockets/unix_socket_windows.go:112
↓ 2 callers
Function
systemRootTrustedX509
()
tlsconfig/systempool_test.go:130
↓ 2 callers
Function
testProxyAt
(t *testing.T, proto string, proxy Proxy, addr string)
proxy/network_proxy_test.go:95
↓ 2 callers
Function
wellKnownAccountName
wellKnownAccountName returns the localized account name for a well-known SID. Windows defines many built-in users and groups by stable well-known SID
sockets/unix_socket_windows_test.go:19
↓ 2 callers
Function
withSDDL
withSDDL applies the given SDDL to the socket. It returns an error when failing parse the SDDL, or if the DACL was defaulted. TODO(thaJeztah); this i
sockets/unix_socket_windows.go:61
↓ 1 callers
Function
ClientDefault
ClientDefault returns a secure-enough TLS configuration for the client TLS configuration.
tlsconfig/config.go:63
↓ 1 callers
Method
Close
Close closes the listener. It will be unavailable for use once closed.
sockets/inmem_socket.go:57
↓ 1 callers
Function
NewInmemSocket
NewInmemSocket creates an in-memory only [net.Listener]. The addr argument can be any string, but is used to satisfy the [net.Listener.Addr] part of t
sockets/inmem_socket.go:31
↓ 1 callers
Function
NewPort
NewPort creates a new instance of a Port given a protocol and port number or port range
nat/nat.go:30
↓ 1 callers
Function
NewTCPProxy
NewTCPProxy creates a new TCPProxy.
proxy/tcp_proxy.go:19
↓ 1 callers
Function
NewUDPProxy
NewUDPProxy creates a new UDPProxy.
proxy/udp_proxy.go:57
↓ 1 callers
Function
ParsePort
ParsePort parses the port number string and returns an int
nat/nat.go:42
↓ 1 callers
Function
ParsePortRange
ParsePortRange parses and validates the specified string as a port range (e.g., "8000-9000").
nat/parse.go:11
↓ 1 callers
Function
ParsePortRangeToInt
ParsePortRangeToInt parses the port range string and returns start/end ints
nat/nat.go:54
↓ 1 callers
Function
ServerDefault
ServerDefault returns a secure-enough TLS configuration for the server TLS configuration.
tlsconfig/config.go:58
↓ 1 callers
Method
clientLoop
(client *net.TCPConn, quit chan bool)
proxy/tcp_proxy.go:40
↓ 1 callers
Function
configureNpipeTransport
(any, string)
sockets/sockets_unix.go:5
↓ 1 callers
Function
configureUnixTransport
(tr *http.Transport, addr string)
sockets/sockets.go:53
↓ 1 callers
Function
generateCertAndKey
()
tlsconfig/fixtures/generate.go:82
↓ 1 callers
Function
generateMultiCert
generates a multiple-certificate CA file with both RSA and ECDSA certs and returns the filename so that cleanup can be deferred.
tlsconfig/fixtures/generate.go:57
↓ 1 callers
Function
getCert
getCert returns a Certificate from the CertFile and KeyFile in 'options', if the key is encrypted, the Passphrase in 'options' will be used to decrypt
tlsconfig/config.go:179
↓ 1 callers
Function
getCertAndEncryptedKey
returns the names of pre-generated, encrypted private key and corresponding certificate file
tlsconfig/config_test.go:35
↓ 1 callers
Function
getPrivateKey
getPrivateKey returns the private key in 'keyBytes', in PEM-encoded format. It returns an error if the file could not be decoded or was protected by a
tlsconfig/config.go:162
↓ 1 callers
Function
isValidMinVersion
isValidMinVersion checks that the input value is a valid tls minimum version
tlsconfig/config.go:124
↓ 1 callers
Function
listenUnix
(path string, opts ...SockOption)
sockets/unix_socket_unix.go:73
↓ 1 callers
Function
newConnTrackKey
(addr *net.UDPAddr)
proxy/udp_proxy.go:27
↓ 1 callers
Method
replyLoop
(proxyConn *net.UDPConn, clientAddr *net.UDPAddr, clientKey *connTrackKey)
proxy/udp_proxy.go:78
↓ 1 callers
Function
splitParts
(rawport string)
nat/nat.go:156
↓ 1 callers
Function
toInt
(s string)
nat/sort.go:105
↓ 1 callers
Function
validateProto
(proto string)
nat/nat.go:112
Method
BackendAddr
BackendAddr returns the TCP proxied address.
proxy/tcp_proxy.go:105
Method
BackendAddr
BackendAddr returns the proxied address.
proxy/proxy.go:23
Method
BackendAddr
BackendAddr returns the backend address.
proxy/stub_proxy.go:23
Method
BackendAddr
BackendAddr returns the proxied UDP address.
proxy/udp_proxy.go:165
Function
BenchmarkParsePortSpecs
(b *testing.B)
nat/nat_test.go:877
Function
BenchmarkSortPortMap
(b *testing.B)
nat/sort_test.go:81
Method
Close
()
proxy/network_proxy_test.go:71
Method
Close
()
proxy/network_proxy_test.go:93
Method
Close
Close stops forwarding the traffic.
proxy/tcp_proxy.go:99
Method
Close
Close does nothing.
proxy/stub_proxy.go:17
Method
Close
Close stops forwarding the traffic.
proxy/udp_proxy.go:152
Function
ConfigureTransport
ConfigureTransport configures the specified [http.Transport] according to the specified proto and addr. If the proto is unix (using a unix socket to
sockets/sockets.go:29
Method
FrontendAddr
FrontendAddr returns the TCP address on which the proxy is listening.
proxy/tcp_proxy.go:102
Method
FrontendAddr
FrontendAddr returns the frontend address.
proxy/stub_proxy.go:20
Method
FrontendAddr
FrontendAddr returns the UDP address on which the proxy is listening.
proxy/udp_proxy.go:162
Method
Len
()
nat/sort.go:13
Method
Len
()
nat/sort.go:45
Method
Less
(i, j int)
nat/sort.go:21
Method
Less
Less sorts the port so that the order is: 1. port with larger specified bindings 2. larger port 3. port with tcp protocol
nat/sort.go:52
Method
LocalAddr
()
proxy/network_proxy_test.go:70
Method
LocalAddr
()
proxy/network_proxy_test.go:92
Method
Network
Network returns the addr string, satisfies net.Addr
sockets/inmem_socket.go:13
Function
NewStubProxy
NewStubProxy creates a new StubProxy
proxy/stub_proxy.go:26
Function
NewTCPSocket
NewTCPSocket creates a TCP socket listener with the specified address and the specified tls configuration. If TLSConfig is set, will encapsulate the T
sockets/tcp_socket.go:12
Function
NewUnixSocket
NewUnixSocket creates a new Unix socket. It sets [BasePermissions] on the socket path and grants the given additional users and groups to generic rea
sockets/unix_socket_windows.go:97
Method
Printf
(_ string, _ ...any)
proxy/logger.go:9
next →
1–100 of 176, ranked by callers