Switch to gorilla/websocket

This commit is contained in:
khlieng 2015-05-02 00:20:22 +02:00
parent c7bf27f8aa
commit d1a82a65b5
41 changed files with 3269 additions and 2304 deletions

View file

@ -5,7 +5,8 @@ import (
"log"
"strings"
"github.com/khlieng/name_pending/Godeps/_workspace/src/golang.org/x/net/websocket"
"github.com/khlieng/name_pending/Godeps/_workspace/src/github.com/gorilla/websocket"
"github.com/khlieng/name_pending/storage"
)
@ -16,12 +17,12 @@ func handleWS(ws *websocket.Conn) {
var UUID string
var req WSRequest
addr := ws.Request().RemoteAddr
addr := ws.RemoteAddr().String()
log.Println(addr, "connected")
for {
err := websocket.JSON.Receive(ws, &req)
err := ws.ReadJSON(&req)
if err != nil {
if session != nil {
session.deleteWS(addr)