Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialAndProxy ¶
DialAndProxy takes a net.Conn "a", and a destination "dest" to dial, and forwards traffic between the connections.
func DialAndProxyTLS ¶
DialAndProxyTLS takes a net.Conn "a", and a destination "dest" to dial with TLS, and forwards traffic between the connections.
Types ¶
type ChannelListener ¶
type ChannelListener struct {
// contains filtered or unexported fields
}
ChannelListener simulates a net.Listener, with Accept simply waiting on a channel to feed it connections. This is needed, as Go's http library does not provide a way to simply handle a single connection, but only supports accepting the connections itself, but can be used for anything that only accepts a net.Listener.
func NewChannelListener ¶
func NewChannelListener(input chan net.Conn, addr net.Addr) *ChannelListener
NewChannelListener returns a fully iniitalized ChannelListener.
func (*ChannelListener) Accept ¶
func (c *ChannelListener) Accept() (conn net.Conn, err error)
Accept waits on the ChannelListeners channel for new connections.
func (*ChannelListener) Addr ¶
func (c *ChannelListener) Addr() net.Addr
Addr returns the net.Addr of the listener.
func (*ChannelListener) Push ¶
func (c *ChannelListener) Push(conn net.Conn)
Push pushes a net.Conn to the ChannelListeners channel.
type HintConn ¶
HintConn is a simple net.Conn wrapper implemented HintedConn.
func NewHintConn ¶
NewHintConn provides a new *HintConn.
type HintedConn ¶
HintedConn describes a net.Conn which also provides hints about transports.
type ProxyConn ¶
ProxyConn simulates reads for the buffered content. When buffer is empty, it simply behaves like the net.Conn it wraps.
func NewProxyConn ¶
NewProxyConn returns a fully initialized ProxyConn.