Skip to content

Harichandra-Prasath/Go-WS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go-Ws

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

  1. For now, It dont handle opcode specific actions
  2. No Extensions
  3. Message frames should follow the rules established for the protocol.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages