SEAPUNK / socketeer

yet another websocket framework
MIT License
3 stars 0 forks source link

Socketeer protocol v3 #57

Open SEAPUNK opened 8 years ago

SEAPUNK commented 8 years ago

Will land in 0.10.0.

Add:

Improve:

SEAPUNK commented 8 years ago

Something to consider is the message format: It could be better if there was less data sent over the wire.

An idea is to have all messages follow this format:

operation(:data)*

So things like action and event messages would be formatted like this, respectively:

SEAPUNK commented 8 years ago

Another thing to consider is putting socketeer in the subprotocol (handshake) section. It would require the client to include something like socketeer2 in the headers, and the server would make sure that the subprotocol exists, before selecting the user specified subprotocol.

SEAPUNK commented 8 years ago

I want binary support to be flexible, allowing them to be sent with actions, events, and action responses.

It will be awfully tricky, though. It's possible it will be not possible to do, simply due to the potential performance tradeoff, API usability (I don't want gotchas), and such.

SEAPUNK commented 8 years ago

Another thing to consider: Max (frame/message/cumulative message) sizes. Maybe the limits should be added in the handshake, so at least the client knows when the server will refuse a message beyond the sizes.

SEAPUNK commented 8 years ago

I'm considering using an all-binary format for message sending and processing. The advantage would be smaller messages. The disadvantage would be utf-8 validation would have to be done with Socketeer and not the websocket library, as well as not being able to decipher what the messages are in the websocket inspection box.