020 7920 7120 | public@publicreative.com

July 26th, 2010

Node AMF

We’ve been having some fun with NodeJS at Public recently, and I’ve been looking for excuses to get more involved with it. We do a lot of Flash work, and make a lot of games, so Flash remoting is something we do regularly. We prefer to use AMF over XML, so I looked around for a NodeJS module to see if we could work with AMF within Node. I figured Node might be a viable platform for creating simple multi-player back ends, or other real-time environments like chat rooms.

I failed to find an AMF library for Node, and I’m not hugely surprised; Flash is rather out of favour with today’s JavaScript gurus. Secretly pleased that I couldn’t find anything, I set about writing my own. It is also the first time I’ve put an open source project on Github.

See node-amf on Github

The current state of node-amf is that it’s not ready for production. I am experiencing errors in the pack and unpack functions which are taken from the excellent php.js project. I hope to hear from the authors to rectify this.

[UPDATE] Now using this BinaryParser class instead of the pack/unpack functions.

The examples in the Git repository are for a simple HTTP gateway – This is the standard way you’d use AMF to talk to PHP, for example. The next step is to see if it’s possible to work with persistent sockets carrying AMF packets. That could be pretty cool.

Tell us what you think!