Live data from Hacker News

Open Sourcing the Stupid-Simple Messaging Protocol

aerofs.com

1–10 of 32 posts

Re: Open Sourcing the Stupid-Simple Messaging Protocol

#6
post #5

Also, since SSMP is completely text-based, does that mean the only way to send binary data is to base64-encode it? Or does it support a length header or chunking similar to HTTP?

It's slightly worse than that: a payload can be any 8-bit data... except a LF character. Which is to say, you will need to either escape or quote it in some way, which is to say you are on your own.

It might have been cleaner to specify base64 encoding or length-prefaced payloads (say, 16 bit int preface indicating length in bytes). As it is, you are on your own.

Re: Open Sourcing the Stupid-Simple Messaging Protocol

#7
post #5

Also, since SSMP is completely text-based, does that mean the only way to send binary data is to base64-encode it? Or does it support a length header or chunking similar to HTTP?

base64 is the preferred way but any 8-bit encoding that doesn't use LF would also work.

There is no support for a length header or chunking as SSMP is designed with small messages in mind.

Re: Open Sourcing the Stupid-Simple Messaging Protocol

#8
post #4

Neat but it's not clear how client authentication is handled in SSMP. I have used XMPP in the past and built-in identity was one of the biggest plusses of the protocol.

Client auth is explained in more details in the spec: https://github.com/aerofs/ssmp

Our most common use case is client certificates but there are provisions for alternate auth schemes.

Re: Open Sourcing the Stupid-Simple Messaging Protocol

#9
post #5

Also, since SSMP is completely text-based, does that mean the only way to send binary data is to base64-encode it? Or does it support a length header or chunking similar to HTTP?

base64 is the preferred way but any 8-bit encoding that doesn't use LF would also work. There is no support for a length header or chunking as SSMP is designed with small messages in mind.

I suggest that you call it the default in your spec and include it in your reference implementation, then.

Re: Open Sourcing the Stupid-Simple Messaging Protocol

#10
I like what I see in the grammar. Very compact and clean. It's actually smaller than the table of contents of XMPP Core spec lol. That's the kind difference that might make an ultra-robust, efficient implementation a bit easier. ;)

Note: Reminds me when I was illustrating Oberon-2 complexity for C and C++ programmers by comparing Oberon-2 BNF to their specs same way. Good way to do prelim assessment of protocol/language complexity and whether it's worth the trouble.

Post reply on HN