Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

socket.io 404 (Not Found) #129

Open
ghost opened this issue Nov 28, 2015 · 4 comments
Open

socket.io 404 (Not Found) #129

ghost opened this issue Nov 28, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented Nov 28, 2015

Hey,

I'm trying to use angular-socket-io in my project that uses grunt serve command to run the Gruntfile.js. Here's what I have done:

  1. Downloaded angular-socket-io and socket.io-client via bower
  2. Added angular-socket-io and socket.io-client libraries in my index.html page
  3. Added btford.socket-io in my app.module at app.js file
  4. Added following code to my Socket.js file which is located in same folder than app.js:
    app.factory('Socket', function (socketFactory) { return socketFactory(); });

Yet I get following error:

GET http://127.0.0.1:9000/socket.io/?EIO=3&transport=polling&t=1448710127650-0 404 (Not Found)

Problem is very obvious. It simply can't find socket.io library. I have installed socket.io via npm. Is it somehow possible to tell angular-socket-io module the location of socket.io that was downloaded via npm?

@nylin93
Copy link

nylin93 commented Jan 6, 2016

I experienced a similar problem when trying to integrate socket.io by itself (without btford.socket-io). In my index.html I changed the file path from:

<script type="text/javascript" src="lib/socket.io/lib/socket.js"></script>

to

<script type="text/javascript" src="/socket.io/socket.io.js"></script>

As the documentation suggests. I haven't integrated btford.socket-io into my project just yet so this may not answer your problem because the included javascript file is different from the ones downloaded via NPM.

@pifpafpof-thomasL
Copy link

Here is a possible answer:
http://howtodevelop.eu/question/reactjs-node-js-socket-io-wont-work-connect-in-reactjs-app,115692#

i.e on your server.js side:
server.listen(port)
instead of
app.listen(port)
!

Also you may need on your client.js side:
const io = require('socket.io-client')

@DevChrisDev
Copy link

i have the same issue.
http://localhost/socket.io/?EIO=3&transport=polling&t=MQaU_0i 404 (Not Found)

@sebnemdemircioglu
Copy link

@DevChrisDev Did you solve this problem?I am getting same error...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants