websocket 增加多分组 fork https://github.com/olahol/melody
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
410 B

package melody
// Package melody implements a framework for dealing with WebSockets.
//
// Example
//
// A broadcasting echo server:
//
// func main() {
// r := gin.Default()
// m := melody.New()
// r.GET("/ws", func(c *gin.Context) {
// m.HandleRequest(c.Writer, c.Request)
// })
// m.HandleMessage(func(s *melody.Session, msg []byte) {
// m.Broadcast(msg)
// })
// r.Run(":5000")
// }