Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsConnectionClosedError ¶ added in v0.21.0
IsConnectionClosedError reports whether err indicates that a connection was closed or aborted by either peer. Callers can use it to ignore routine connection shutdown or broken pipe errors reported to Proxy.OnError.
Types ¶
type Proxy ¶
type Proxy struct {
Listener net.Listener
RemoteAddr string
DialContext func(ctx context.Context, network, address string) (net.Conn, error)
// OnError is called for errors that occur during proxying individual connections. It may be called concurrently
// for different connections.
OnError func(error)
// contains filtered or unexported fields
}
Proxy proxies local connections to a remote TCP address optionally using a custom dialer.
Click to show internal directories.
Click to hide internal directories.