clone of  https://github.com/garyburd/go-websocket