FlashSocket.IO, policyfile and Socket.IO Error : Failed to load policy file from xmlsocket://localhost:843

326 views Asked by At

Following my code for creating the server and policyfile server:

var app = require('http').createServer(handler)
  , io = require('socket.io').listen(app),  fspfs = require('policyfile')
  , fs = require('fs'), url = require('url');

  flash = fspfs.createServer();

  flash.listen(10081,app, function(){
        console.log(':3 yay');
    });
app.listen(3000);

on Flash I initialize the sockets like, socket = new FlashSocket("localhost:3000"); socket.addEventListener(FlashSocketEvent.CONNECT, onConnect); socket.addEventListener(FlashSocketEvent.MESSAGE, onMessage); socket.addEventListener(FlashSocketEvent.IO_ERROR, onError); socket.addEventListener(FlashSocketEvent.SECURITY_ERROR, onError);

When I run the application I get teh following error:

Error: Failed to load policy file from xmlsocket://localhost:843

*** Security Sandbox Violation ***
Connection to localhost:3000 halted - not permitted from http://dev/FlashSockets_Demo-debug/FlashSockets_Demo.swf
Error: Request for resource at xmlsocket://localhost:3000 by requestor from http://dev/FlashSockets_Demo-debug/FlashSockets_Demo.swf is denied due to lack of policy file permissions.
0

There are 0 answers