Richeve Bebedor
Richeve Bebedor

Reputation: 1658

Cloud Foundry and Socket.IO Cross Domain Policy Issue

I'm receiving this kind of message everytime the browser load this URL:

http://volkova.cloudfoundry.com/socket.io/socket.io.js

<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"><cross-domain-policy><allow-access-from domain="*" to-ports="*"/></cross-domain-policy>

I tried doing the authorization part for socket.io but no luck.

This is my part of code for configuring the socket.io

io = _.socketio.listen( _.serverdata.xserver, { log: true } );
    if( process.env.VMC_APP_PORT ){
        io.set( "transports", [
            "flashsocket",
            "htmlfile",
            "xhr-polling",
            "jsonp-polling"
        ] );
        io.configure( function( ){
            io.set( "authorization",
                function( handshakeDate, callback ){
                    //TODO: Provide level of security here
                    callback( null, true );
                } );
        } );
    }

When I tried my codes locally, everything is working fine.

In the client side I'm doing this:

<script src="http://volkova.cloudfoundry.com/socket.io/socket.io.js"></script>

socket = io.connect( "http://volkova.cloudfoundry.com" );

Is there anything missing from my codes? Or any configurations I missed?

Thanks for the help!

Upvotes: 1

Views: 597

Answers (1)

Dan Higham
Dan Higham

Reputation: 3984

would it be possible to see the complete source for your application, I deployed the example Socket.IO app (from their home page) and it appeared to work OK.

http://socket-io-example.cloudfoundry.com/socket.io/socket.io.js

It may be an issues if your are trying to connect from one domain to another.

Upvotes: 1

Related Questions