amf_deserializer

module to deserialize raw AMF post data

npm install amf_deserializer
37 downloads in the last month

IMPORTANT NOTICE

Highly Unstable Module! (early alpha)

This module is currently under active developement and should NOT be used in production yet as it contains many bugs and its syntax is very likely to change in a near future. If you still want to use this module, try it in seperate folder other than your main project folder; Please make sure to check for updates on a daily basis to ensure you have the latest version.

What is amf_deserializer ?

This module can parse raw AMF0 (and soon AMF3) data posted to your nodejs server. This module will be part of my upcoming module "AmfHandler" which is intended to replace AMFPHP on my server

How it works?

amf_deserializer uses the built-in Buffer module to mimic ByteArray

Using with Express:

var AMFDeserializer = require("amf_deserializer"),
express = require("express"),
app = express();

app.post("/*",function(req,res){
    if(req.is("application/x-amf")){ //check if we are receiving AMF data
        var body=""; //create empty variable to store raw data
        req.addListener("data",function(chunk){
            body += chunk //add data chunk to "body"
        });
        req.addListener("end",function(){
            var parser = new AMFDeserializer(body);
            var header = parser.readHeader();
            var data = parser.readBody();
            // => add your function here to handle the data
        });
    }
    else{
        next(); //the received data is not AMF so we just tell Express to continue to the next handler
    }
});
// => add your other handlers here

app.listen(80);


Documentation

No documentation available at the moment; the module is still at an early developement and the syntax can change at any time

npm loves you