diff --git a/melody.go b/melody.go index 3bf8ea0..7f63c89 100644 --- a/melody.go +++ b/melody.go @@ -88,6 +88,7 @@ func (m *Melody) HandleRequest(w http.ResponseWriter, r *http.Request) { session := &Session{ Request: r, + Params: make(map[string]interface{}), conn: conn, output: make(chan *envelope, m.Config.MessageBufferSize), melody: m, @@ -95,7 +96,7 @@ func (m *Melody) HandleRequest(w http.ResponseWriter, r *http.Request) { m.hub.register <- session - go m.connectHandler(session) + m.connectHandler(session) go session.writePump() diff --git a/session.go b/session.go index 8645d5b..6b040e6 100644 --- a/session.go +++ b/session.go @@ -10,6 +10,7 @@ import ( // Session is wrapper around websocket connections. type Session struct { Request *http.Request + Params map[string]interface{} conn *websocket.Conn output chan *envelope melody *Melody