I’m trying to get a nodejs socket server running that will allow remote communication between two clients running a Flash game that communicates using a custom protocol. Due to Flash security restrictions, it seems that the socket server must be running on the same host as the web server that servers the Flash game. I’ve been continuously getting the following error:
The service crashed at startup or is listening to the wrong port. It failed to respond on port "nodejs" (8080) within 30 seconds
What I need is a way to run my nodeJS server code, while simultaneously serve the flash files.
I’m using the environment JSON variables to determine what port to listen on, and my YML is similar to the one discussed here but no luck…
Just wondering if I can get some info on how to create a working socket server/web server that will work for this (or if it is actually possible)
You can use the following
dotcloud.ymlfile:Then in your Node.js app, you can bind a HTTP server to port 8080, and an arbitrary TCP server to the port contained by environment variable
$PORT_MYTHING. Then rundotcloud infoon your service; in theportssection, you will see something like this:From now on, if you connect to
myapp-johndoe.dotcloud.comon port12345, you will actually connect to$PORT_MYTHINGin your application.I hope that it makes sense, and that it is what you were looking for!