Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenPipe ¶
func ListenPipe() *pipeListener
ListenPipe creates a pipeListener that implement net.Listener and Dialer.
The returned Listener and Dialer operate on the same in-memory channel. Calling Dial on the Dialer will return a Conn that can be used to communicate with a Conn accepted from the Listener.
func RegisterDialerFactory ¶ added in v0.2.4
func RegisterDialerFactory(scheme []string, factory func(u *url.URL, dialer ContextDialer) (ContextDialer, error)) error
Types ¶
type ContextDialer ¶
type ContextDialer interface {
// Returns connection if successful, or an error.
// The context is used to cancel the dial. It will return a non-nil error if the context is done.
// ctx should be ignored after connection is established.
DialContext(ctx context.Context, network, address string) (net.Conn, error)
}
A ContextDialer dials using a context.
func CreateDialer ¶ added in v0.2.4
func CreateDialer(u *url.URL, dialer ContextDialer) (ContextDialer, error)
type DialContextFunc ¶ added in v0.2.0
func (DialContextFunc) Dial ¶ added in v0.2.0
func (f DialContextFunc) Dial(network, address string) (net.Conn, error)
func (DialContextFunc) DialContext ¶ added in v0.2.0
type Dialer ¶
type Dialer interface {
// Dial connects to the given address
Dial(network, addr string) (c net.Conn, err error)
}
A Dialer is a means to establish a connection. Custom dialers should also implement ContextDialer.
type ForwarderFunc ¶
type OverrideAddr ¶ added in v0.2.4
func (*OverrideAddr) Network ¶ added in v0.2.4
func (a *OverrideAddr) Network() string
func (*OverrideAddr) String ¶ added in v0.2.4
func (a *OverrideAddr) String() string
type OverrideConn ¶ added in v0.2.4
func (*OverrideConn) LocalAddr ¶ added in v0.2.4
func (c *OverrideConn) LocalAddr() net.Addr
func (*OverrideConn) RemoteAddr ¶ added in v0.2.4
func (c *OverrideConn) RemoteAddr() net.Addr
type OverrideListener ¶ added in v0.2.4
type PrefixConn ¶
PrefixConn will first read Prefix until EOF, and then read the content from Conn.
type ServeMux ¶
type ServeMux struct {
// contains filtered or unexported fields
}
ServeMux will forward the connection (Conn) to different Forwarders based on the rules.
func (*ServeMux) HandlePrefix ¶
func (*ServeMux) HandleTLSProto ¶ added in v0.2.0
Source Files
¶
Click to show internal directories.
Click to hide internal directories.