Documentation ¶
Overview ¶
Package websocket implements a websocket reader/writer. The implementation heavily based on the VW Video Streaming server (https://github.com/timdrysdale/vw).
The code was originally taken on 2022-03-24 from the below address https://github.com/timdrysdale/vw/blob/6dbe6d197ddaf1578edbfb969a73c7ec45d29e98/cmd/handleWs.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller defines a websocket controller for managing websocket connections
func NewController ¶
func NewController(msgChan chan []byte) *Controller
NewController will initialise a new instance
func (*Controller) ForwardMessages ¶
func (c *Controller) ForwardMessages()
ForwardMessages will iterate messages and send them to connected clients
func (*Controller) HandleWs ¶
func (c *Controller) HandleWs(w http.ResponseWriter, r *http.Request)
HandleWs handles a websocket connection and records a client instance
Click to show internal directories.
Click to hide internal directories.