blob: 6d1547d5ae79ac495321370a2f554448795a548f [file] [log] [blame]
package main
import (
"code.google.com/p/go.net/websocket"
"fmt"
"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?")
}