Documentation
¶
Overview ¶
Package rudia implements a simple library for relaying TCP string messages from one source to many clients.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repeater ¶
type Repeater struct {
// contains filtered or unexported fields
}
A Repeater connects to an upstream TCP endpoint and relays the messages it receives to all connected clients.
func NewRepeater ¶
func NewRepeater(options *RepeaterOptions) *Repeater
NewRepeater creates a new Repeater and starts listening for client connections.
func (*Repeater) ListenAndAcceptClients ¶
ListenAndAcceptClients listens to the specified adddress for new TCP clients and upon successful connect, adds them to the pool of clients to relay any messages received to.
func (*Repeater) ListenAndAcceptUpstreams ¶
ListenAndAcceptUpstreams listens to the specified adddress for new TCP upstreams and upon successful connect, adds them to the pool of upstreams to relay any messages received from.
func (*Repeater) Proxy ¶
Proxy connects to the specified TCP address and relays all received messages to connected clients. If the connection to the specified address fails, an attempt will be made to reconnect. This will repeat until the program exits.
func (*Repeater) Push ¶
Push connects to the specified TCP address and relays all received messages from upstreams to it. If the connection to the specified address fails, an attempt will be made to reconnect. This will repeat until the program exits.