Node.js TCP server for serving Flash cross domain policy requests

If you have some flash application talking to back-end via TCP, then it would be useful for you to launch special cross domain policy server on 843 port:

sudo bash -c “exec nohup setsid node policy_server.js 0<&- &”

// policy_server.js
var server = require(“net”).createServer(function(socket) {
    socket.on(‘error’, function(err) {});
    socket.end(‘<cross-domain-policy><allow-access-from domain=”*” to-ports=”*”/></cross-domain-policy>’);
});
server.on(‘error’, function(err) {});
server.listen(843);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: