Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dialer ¶
type Dialer struct {
// contains filtered or unexported fields
}
func NewDialer ¶
func NewDialer(rawDialer *net.Dialer, serveMux *http.ServeMux, minimumInterval, maximumInterval time.Duration, logger log.DebugLogger) *Dialer
NewDialer creates a dialer that may be used to make connections. It also registers a HTTP handler for receiving connections from remote systems which have requested connections. When the Dial method is called, if a new connection has been received it is used instead of dialing out the normal way. If rawDialer is nil, the default dialer is used to dial out when needed. If serveMux is nil then the default http.ServeMux is used. NewDialer may be called only once per serveMux. The minimumInterval and maximumInterval parameters are passed back to remote systems which are making connections, overriding their default configuration.
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
func Listen ¶
Listen creates a listener which may be used to accept incoming connections. It listens on all available IP addresses on the local system.
func (*Listener) RequestConnections ¶
RequestConnections starts a goroutine which will periodically attempt to establish a connection with a remote server if there is no incoming connection from the remote server. The connection that is established will be returned by the Accept method. The configuration information for the remote server is read from the JSON-encoded file with filename: "/etc/reverse-listeners/"+serviceName with the format ReverseListenerConfig.
type ReverseListenerConfig ¶
type ReverseListenerConfig struct { Network string // May be empty or "tcp". ServerAddress string // Address of the remote server. MinimumInterval time.Duration // Minimum interval to request connections. MaximumInterval time.Duration // Maximum interval to request connections. }
ReverseListenerConfig describes the configuration for a remote server for which connections are requested.