amf-packet
v1.0.2
Published
AMF0 packet serializer and deserializer
Downloads
281
Readme
About
AMF0 packet serializer and deserializer.
Usage
Install using npm:
$ npm install amf-packet
Serialize
const { serializeAMF } = require('amf-packet');
const headers = {
'foo': 'bar',
};
const messages = [{
'targetUri': 'Service.doSomething',
'responseUri': '/0',
'body': [],
}];
console.log(serializeAMF(headers, messages));
Deserialize
const { deserializeAMF } = require('amf-packet');
const {
headers,
messages,
} = deserializeAMF(buf);
const {
targetUri,
responseUri,
body,
} = messages[0];
Implementation notes
The must-understand flag of headers is not implemented.
Message body can be any value supported by amf-codec.