There are several modification you need to make to the tutorial code if you 
want to run it on AppFog.

On AppFog, you cannot listen on port 8000. Instead you should use the port 
number passed to your program in the VCAP_APP_PORT env variable.
For example:

app.listen( process.env.VCAP_APP_PORT || 8000);  // this will work on 
AppFog and on localhost

Second, socket.io will work on AppFog, but you may need to configure it to 
use long polling, since websockets is not supported yet.
It should fall back automatically, so this may not be necessary, but here 
is how you can configure that:
io.set('transports',[ 'xhr-polling' ]);


Third, you should remove the hostname and port in the io.connect call in 
client.html. Just use this:
io.connect()

The proper url and port will be auto-discovered.


On Monday, January 21, 2013 4:05:24 PM UTC-8, Bruno Araújo wrote:
>
> Hi,
>
> I'm noob on nodejs and i'm trying some tutorials of nodejs. I'm trying 
> this tutorial: http://cestfait.ch/content/chat-webapp-nodejs it works 
> wonderful on my localhost but not when I upload to appfog like you can see 
> here: http://nodebruno.hp.af.cm/
>
> For example, the prompt don't show up. I changed the code to avoid the 
> prompt and insert the nickname on a input text and this work on localhost 
> but doesn't work on appfog too.
>
> Can you help me ?
>
> Bruno
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to