blob: 3e1c46961420d56358d326234ffb367ebf438899 [file] [log] [blame]
// +build OMIT
package main
import (
"fmt"
"golang.org/x/net/websocket"
"net/http"
)
func main() {
http.Handle("/", websocket.Handler(handler))
http.ListenAndServe("localhost:4000", nil)
}
func handler(c *websocket.Conn) {
var s string
fmt.Fscan(c, &s)
fmt.Println("Received:", s)
fmt.Fprint(c, "How do you do?")
}