IPFS ping protocol

After “/plaintext/1.0.0” I send: \0b00001000 \0x01 \x0A
Which by my logic would be how to initiate the multiplexing:

  • first character (from the right): 000 = new stream, 00001 = stream id
  • second character (length of data): 1, i.e. 1 byte
  • third character (data): just a new line

I get back: \0x13/multistream/1.0.0\n

  • first character \0x13 is 19, the length of the data
  • next is the data

Anything I send after this with a header \b00001010 (message initiator, stream id=1) or \b00001001 (message receiver, stream id=1) or without a header causes to drop the connection.
For example I tried both headers (or without one) + \0x13/multistream/1.0.0\n and it drops. I’ve tried also with /ipfs/ping/1.0.0, of course with the length before it.

What am I doing wrong?