Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement framing protocol #11

Open
doronguttman opened this issue Oct 13, 2020 · 0 comments
Open

Implement framing protocol #11

doronguttman opened this issue Oct 13, 2020 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@doronguttman
Copy link
Contributor

see: http://sockjs.github.io/sockjs-protocol/sockjs-protocol-0.3.3.html#section-42

SockJS client accepts following frames:

  • o - Open frame. Every time a new session is established, the server must immediately send the open frame. This is required, as some protocols (mostly polling) can't distinguish between a properly established connection and a broken one - we must convince the client that it is indeed a valid url and it can be expecting further messages in the future on that url.

  • h - Heartbeat frame. Most loadbalancers have arbitrary timeouts on connections. In order to keep connections from breaking, the server must send a heartbeat frame every now and then. The typical delay is 25 seconds and should be configurable.

  • a - Array of json-encoded messages. For example: a["message"].

  • c - Close frame. This frame is send to the browser every time the client asks for data on closed connection. This may happen multiple times. Close frame contains a code and a string explaining a reason of closure, like: c[3000,"Go away!"].

Framing accepted by the server

  • SockJS server does not have any framing defined. All incoming data is treated as incoming messages, either single json-encoded messages or an array of json-encoded messages, depending on transport.
@doronguttman doronguttman added the enhancement New feature or request label Oct 13, 2020
@doronguttman doronguttman added this to the v2.0.0 milestone Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant