Documentation ¶
Overview ¶
This package contains the implementation of a simple echo websocket
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EchoWebsocketServer ¶
type EchoWebsocketServer struct {
// contains filtered or unexported fields
}
Structure for the websocket server
func NewEchoWebsocketServer ¶
func NewEchoWebsocketServer(httpServer *http.Server, logger *log.Logger) *EchoWebsocketServer
Description ¶
Factory which creates a new, non-started EchoWebsocketServer.
Inputs ¶
httpServer: The underlying HTTP Server to use. The provided HTTP Server handler will be overriden with this server handler. If nil is provided, a default HTTP server listening on localhost:8080 will be used.
logger: Logger to use. If nil, default logger will be used
Returns ¶
A new, non-started EchoWebsocketServer or an error if any has occured.
func (*EchoWebsocketServer) ServeHTTP ¶
func (srv *EchoWebsocketServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
Description ¶
Server handler which accepts incoming websocket connections.
func (*EchoWebsocketServer) Start ¶
func (srv *EchoWebsocketServer) Start() error
Description ¶
Start the websocket server that will accept incoming websocket connections.