summaryrefslogtreecommitdiff
path: root/websock.go
diff options
context:
space:
mode:
Diffstat (limited to 'websock.go')
-rw-r--r--websock.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/websock.go b/websock.go
index bdb7546..6b69788 100644
--- a/websock.go
+++ b/websock.go
@@ -3,7 +3,6 @@ package main
import (
"code.google.com/p/go.net/websocket"
"github.com/gorilla/mux"
- "log"
"net/http"
)
@@ -54,8 +53,14 @@ func AcceptWebSock(rw http.ResponseWriter, req *http.Request) {
continue
}
- // TODO: Broadcast messsage
+ buddy.Say(s)
}
}()
+
+ for m := range buddy.Receive {
+ if send(m) != nil {
+ return
+ }
+ }
}).ServeHTTP(rw, req)
}