Experimental WebSocket Server for Go. Use it on your own risk.
For now, can recieve and write messages back to websocket.
Create a Websocket Server and start it.
server := gows.NewWebSocketServer(gows.ServerConfig{
Addr: ":5000",
})
server.Start()
Accept the incoming connection
wsconn,_ := server.Accept()
Connections will be accepted as FIFO. It's user responsibility to handle individual connections.
Read from the accepted connection
message,_ := wsconn.Read()
fmt.Println(string(message))
Write to the connection
wsconn.Write([]byte("Hello World"))
Notes
- For now, It dont handle opcode specific actions
- No Extensions
- Message frames should follow the rules established for the protocol.