Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>EDIT</strong> : all the below text is wrong until the next "EDIT". Leaving it there as a trace...</p> <p>there is one thing you should know, two things you should do + all needed <a href="http://expressjs.com/guide.html#configuration" rel="noreferrer">Express doc is here</a> :</p> <ol> <li>Express filter/handle every access to your node server. It means that when you're trying to access your socket.io script file, Express tries to find it in the routes you declared and fails as you didn't (and you were right not to).</li> <li><p>Most important : declare a static, non "computed" folder in express where you will put all your static files (css, client scripts, images) :</p> <p><code>app.use('/static', express.static(__dirname + '/static'));</code></p> <p>This line must be put in you <code>app.configure</code> call, before <code>app.use(app.router)</code> (I actually put it first)</p> <p>I like to have this /static/scripts ; /static/css ; /static/img folder organisation but you're free to adapt to your needs.</p></li> <li><p>Change the link to the socket.io script file to a relative path (optional but strongly advised) : <code>src='/static/scripts/socket.io/socket.io.js'</code></p></li> </ol> <p><strong>EDIT</strong> : I am wrong, very very wrong and I am sorry for that. Socket.io generates the different path / files needed and you don't have to declare them nor to copy any client script files.</p> <p>Please try switching the <code>&lt;script src="http://192.168.1.104:81/socket.io/socket.io.js"&gt;&lt;/script&gt;</code> client line to the normal relative one <code>&lt;script src="/socket.io/socket.io.js"&gt;&lt;/script&gt;</code> because that's the only difference between your code and the express guide code.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload