1

I'm trying to deploy a node.js with socket.io app on Webbynode but all I'm seeing is "Welcome to socket.io." when I try to access the app in the browser. Its running on a Nginx webserver.

I see someone else here had a similar problem but I am referencing socket.io correctly :

<script src="/socket.io/socket.io.js"></script>

The app runs fine on my testing environment

Any ideas of what I could be doing wrong?

Thanks!

uguMark
  • 609
  • 1
  • 5
  • 17

1 Answers1

1

Nginx doesn't support HTTP 1.1, Websockets, read more here: http://blog.mixu.net/2011/08/13/nginx-websockets-ssl-and-socket-io-deployment/

alessioalex
  • 62,577
  • 16
  • 155
  • 122
  • If you can, just use Node. Apache isn't a good solution either since it creates a new thread per connection, thus eliminating Node's advantage of low memory footprint and high concurrency. – alessioalex Dec 11 '11 at 10:25
  • I'm running PHP as well so would it still be possible to not run apache? Also how can I make sure requests only go through Node and not Apache? – uguMark Dec 11 '11 at 11:10
  • 1
    Ok in that case you could use Nginx / Apache and run Socket.IO on a different port ( 8080 for example ), standalone. In your application you would have to require the socketio.js file using the hostname and port (server:port/socket_io_file.js). Also you should make sure that the chosen port is publicly accessible. – alessioalex Dec 11 '11 at 11:27