Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpstreamHandler ¶
func UpstreamHandler(addr string) http.HandlerFunc
UpstreamHandler proxies HTTP requests to running WebSocket server or application.
Types ¶
type App ¶
type App struct { Clients []*Client // contains filtered or unexported fields }
App contains logic of client interfaction.
func NewApp ¶
func NewApp(logger *zap.SugaredLogger) *App
NewApp inits new app instance and returns it.
func (*App) InitClient ¶
InitClient initializes reading client input messages.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client defines websocket connection. It contains logic of receiving and sending messages. That is, there are no active reader or writer. Some other layer of the application should call Receive() to read user's incoming message.
type Server ¶
type Server struct { App *App // contains filtered or unexported fields }
Server contains options and methods for running zero-copy websocket server on straight TCP connection. Use in a combination of UpstreamHandler.
Click to show internal directories.
Click to hide internal directories.