How to set up my socket.io server for reveal.js?

I am trying to set up a reveal.js presentation with Multiplexing. As the public socket.io server http://revealjs-51546.onmodulus.net/ is no more active, I decided to try to set up my own on DigitalOcean. I am running Nginx as a reverse proxy server on DO. I have added:

location /myslides/ {
  proxy_pass http://myPrivateIP:1948/;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection 'upgrade';
  proxy_set_header Host $host;
  proxy_cache_bypass $http_upgrade;
}

in my /etc/nginx/sites-available/default file. I installed node, cloned the reveal.js git repo, then cd reveal.js and npm install. When I launch the plugin/multiplex/index.js script, everything seems to be fine: I get a secret string and id when browsing to http://example.org/token, so the app is running. The app code is the standard reveal multiplex one: https://github.com/hakimel/reveal.js/blob/master/plugin/multiplex/index.js. I set up the following config in my HTML file (served from another site):

multiplex: {
   secret: 'secretnumber',
   id: 'secretid',
   url: 'example.org/myslides'
},

dependencies: [
    { src: 'lib/js/classList.js' },
    { src: 'plugin/math/math.js', async: true },
    { src: 'http://cdn.socket.io/socket.io-1.3.5.js', async: true },
    { src: 'plugin/multiplex/client.js', async: true },
    { src: 'plugin/multiplex/master.js', async: true }
]

But multiplexing does not work. I keep getting:

http://example.org/socket.io/ 404 not found

on the client side. I understand that something is not properly configured as path is concerned but don't know what. I tried to create a socket.io/ directory in my reveal.js server dir, and copy the socket.io.js source file within. I did the same in the plugin/multiplex subdir but to no avail. I spent some hours on this today, and feel kind of frustrated. Would there be any good soul with a hint?

Answers


Oops.. I simply solved this by defining a proper location /sockets/ in my /etc/nginx/sites-available/default file. Sorry for the noise. Best, Yvonnick


Need Your Help

c# extension method with linq

c# linq lambda

I want to write an extension method to filter all the people with towns in a people object with the towns in shop object