wandenberg / nginx-push-stream-module

A pure stream http push technology for your Nginx setup. Comet made easy and really scalable.
Other
2.22k stars 295 forks source link

WS close code for unauthorized channels #78

Closed dctrwatson closed 10 years ago

dctrwatson commented 11 years ago

We are working to reduce the number of open connections and silent channels.

Catching 403 for switching to periodic polling for normal endpoint was doable. However, with websockets, it's hard/impossible to distinguish 403 from an error.

WS support arbitrary close codes, would it be possible to send close code explaining it's unauthorized so the connection may gracefully close?

wandenberg commented 11 years ago

Hi @dctrwatson ,

are you using the pushstream.js or another client? The close frame is sent only when the websockect connection is already opened. The 403 response is sent before the open handshake is finished. So the close code cannot be sent on this moment.

wandenberg commented 10 years ago

This was solved on tag 0.4.0 3d3a204177d3a7ab8a2858e04e792a6d11bf133f