2

I intend to use a Rails app to serve real-time data processed by a node.js server and Socket.io.

In the Socket.io website, it says that:

If you won't leverage Node.JS to serve your files, make sure to set the global WEB_SOCKET_SWF_LOCATION to the location of the WebSocketMain.swf file.

What does it means exactly if I use rails to serve the static files?

Also, from the FAQ:

I want to host the Socket.IO client myself:

If you're not relying on Node.JS serving Socket.IO clientside JavaScript files, make sure you set the WEB_SOCKET_SWF_LOCATION right after including socket.io.js with the location of the WebSocketMain.swf This is required in order for Socket.IO to find the .swf file required for Flash WebSocket.

However, I don't quite get it.

Thanks.

1
  • 1
    I believe it means that within the SWF Source code you need to change WEB_SOCKET_SWF_LOCATION to point to the location where node.js is serving the data from Commented Apr 5, 2011 at 11:52

1 Answer 1

7

WebSocketMain.swf file is used as part of the Flash based socket communication which is one of the fallback solutions when WebSocket transport is not available. This is a static file and by default it is served internally by socket.io. However if you intend to serve this file with your RoR application, you should set the WEB_SOCKET_SWF_LOCATION in order to socket.io being able to locate the WebSocketMain.swf file and use it in fallback case.

For example if you are running standalone socket.io server, it is running lets say on port 8080 and is serving files from there. However if you add RoR, which runs on port 80, and you want to serve also socket.io static files with RoR, then you should instruct socket.io about the location of WebSocketMain.swf file since RoR is using different port or path to serve it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.