-2

I am following the tutorial given at the url: https://codelabs.developers.google.com/codelabs/webrtc-web/#6

When I run the server and open index.html on browser then it gives me error http://localhost:8080/socket.io/?EIO=3&transport=polling&t=1486104971951-58 (not found) I have done everything which I could but I can't get rid of this error.

halfer
  • 19,824
  • 17
  • 99
  • 186
bee
  • 1
  • 1
  • Without your code **in the question itself** it may not be possible for people to help you. Please show us the relevant part of your code and what you have done to resolve this problem. – halfer Feb 05 '17 at 17:08

1 Answers1

0

Install Socket.io inside your repository:

npm install socket.io --save 

After, config the index.js(file from your tutorial):

   var express = require('express')
   var app     = express();
   var server  = require('http').createServer(app);
   var io      = require('socket.io').listen(server);

   server.listen(app.get('80')); 

And inside your archive HTML/EJS or another you want, add:

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

Check if works with Console (Chrome/ Mozilla, etc).

In my example I use Chrome (Ctrl + shift + I):

enter image description here

Sayuri Mizuguchi
  • 5,250
  • 3
  • 26
  • 53