Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
melody
✓ gopkg.in/olahol/melody.v1
Simple WebSocket echo server
package main
import (
"net/http"
"gopkg.in/olahol/melody.v1"
)
func main() {
m := melody.New()
http.HandleFunc("/ws", func(w http.ResponseWriter, r *http.Request) {
m.HandleRequest(w, r)
})
m.HandleMessage(func(s *melody.Session, msg []byte) {
m.Broadcast(msg)
})
http.ListenAndServe(":5000", nil)
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
1.0.0-20170518105555-d52139073376latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.