[Html] package main import ("code.google.com/p/go.net/websocket" "fmt" "log" "net/http" "html/template") func Echo (ws * websocket. conn) {var err error for {fmt. println ("start") var reply string if err = websocket. message. receive (ws, & reply); err! = Nil {fmt. println ("can't receive") break} fmt. println ("received back from client:" + reply) msg: = "replicated ed:" + reply fmt. println ("Sending to cient:" + msg) if err = websocket. message. send (ws, msg); err! = Nil {fmt. println ("Can't send") break }}} func chat (w http. responseWriter, r * http. request) {r. parseForm () fmt. println (r. form) t, _: = template. parseFiles ("websocket_demo.html") t. execute (w, nil)} func main () {http. handle ("/", websocket. handler (Echo) http. handleFunc ("/chat", chat) if err: = http. listenAndServe (": 9999", nil); err! = Nil {log. fatal ("ListentAndServe:", err )}} ========================================================== ========================================================== ===========< html>