I am trying to write a client library for NATS.io. According to the protocol here, \n\r
is used to delimiting commands, payload, etc.
INFO {"server_id":"1ec445b504f4edfb4cf7927c707dd717","version":"0.6.6","go":"go1.4.2","host":"0.0.0.0","port":4222,"auth_required":false,"ssl_required":false,"max_payload":1048576}
My question is what if the payload contains \r\n
? I couldn't find any information about how to escape \r\n
. Should one read INFO
until a valid JSON is received and not look for \r\n
as delimiter?
Thanks for your time!