blob: b54b6d4a0c1f10ded4fcea261bb49131962320a9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// Copyright 2015 Ola Holmström. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package melody implements a framework for dealing with WebSockets.
//
// Example
//
// A broadcasting echo server:
//
// 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)
// }
package melody
|