Use our own websocket.Server instance.

The websocket.Server used the by websocket.Handler type automatically adds
a handshake function which prevents connections when the Origin header is
not set.  Not all clients send this information and we already require
authentication headers as the auth mechanism anyways.
This commit is contained in:
Dave Collins 2014-01-17 15:03:43 -06:00
parent 737e69594b
commit 0fbd962f8a

View file

@ -152,7 +152,10 @@ func (s *rpcServer) Start() {
http.Error(w, "401 Unauthorized.", http.StatusUnauthorized)
return
}
websocket.Handler(s.walletReqsNotifications).ServeHTTP(w, r)
wsServer := websocket.Server{
Handler: websocket.Handler(s.walletReqsNotifications),
}
wsServer.ServeHTTP(w, r)
})
for _, listener := range s.listeners {