automatic unwanted continuous anonymous socket calls /socket.io/?EIO=3&transport=websocket - node.js

I'm getting continuous automatic unwanted anonymous socket calls GET /socket.io/?EIO=3&transport=websocket 404 on my nodeapp.
I've not implemented any socket module in code.
So my question is why I'm getting this 404 requests?
Code was working on Centos6, I've just switched to Centos7 installed node 0.12.2 and tried running code using node bin/www command.

Related

Nest JS server returning 404 response to all the routes after changing node JS version on my machine

I am running my Nest JS application on my local server's PORT 3000 and my node version is 16.5.0. My application has multiple routes and all were giving correct responses. There was a requirement where I had to downgrade the node version to 14.17.0. After this change, I started my server again and here the problem comes. All the routes started giving the response like POST /user 404 not found and GET /user/:id 404 not found.
I have reverted back to node version 16.5.0 and removed the node_modules and re-installed it again and restarted the server as well. But still, I am getting the same issue.
All the approaches I tried above failed to resolve the issue. The only way which resolved the issue is by restarting the system and running the server again.

How to find out why I get 500 error from Firebase on server but not on localhost

I try to run my first node application on my server from subdomain. It works perfectly on my PC but when I move it to the server, seems everything works, site loads with all js except Firebase.
I get the following errors in chrome:
/firebase/firestore net::ERR_ABORTED 500 (Internal Server Error)
/firebase/app net::ERR_ABORTED 500 (Internal Server Error)
The 2 lines of my my .js triggers the error:
import firebase from '/firebase/app';
import '/firebase/firestore';
Obviously it can mean millions different issues but I have no idea how to find any logs or anything what would tell me why this error triggered.
I tried to turn off/on https. I checked logs on server but found nothing just the same 500 error in access log. I tried but couldn't find any node specific log on the server. I tried to re-install firebase. After I tried to re-install node and everything and re-started from scratch.
I tried to copy the whole node_modules folder to the server from my PC but didn't help.
I would expect it to run just as on localhost or at least see some log about the error so I could fix it. The server is Linux VPS with plesk obsidian. The app is on a subdomain, the main domain has php website running.

Node.js socket hang up when agent is present

I have the following setup:
Client => Proxy server => Origin Server
I'm using the following Node.js libraries for each of these pieces, respectively:
isomorphic-fetch => http-proxy => http
Here's a gist of the setup in two files, one for each of the servers and one for the client: https://gist.github.com/headquarters/850cbb199ff397c6da56fb8d86113a7e
To run this locally, run node server.js in one shell and node fetch.js in another shell.
With the servers running, if I go to http://localhost:8818 in a browser, I get the sample response {"a":"b"}, so that's working. If I go to http://localhost:9818, I also get that response, so the proxying appears to be working fine. However, if I run DEBUG=* node fetch.js, which includes the HTTP proxy agent, the request fails (see output at https://gist.github.com/headquarters/850cbb199ff397c6da56fb8d86113a7e#file-failure-txt).
Without the agent property, the fetch command works fine on the command line. How do I go about debugging this socket hang up error?
Turns out I didn't read the https-proxy-agent docs closely enough. This line was a bit confusing: An HTTP(s) proxy http.Agent implementation for HTTPS--the PROXY itself can be either HTTP or HTTPS, but the origin server has to be HTTPS for this flavor of proxy-agent. For an HTTP origin server, I had to use http-proxy-agent. Thus, the socket hang up was probably coming from https.Agent trying to access an HTTP endpoint. It worked when I switched to http-proxy-agent.

unable to run express 2.5.8 on ubuntu 11 on amazon aws

I am using express 2.5.8 on ubuntu 11 (amazon aws). I have connect 1.7.2 & node 0.6.15. I am able to run node (listen on port 3000 for instance) - however, when I use express, it appears to throw the following error:
got an uncaught error: Uncaught, unspecified 'error' event
There is no other service bound on that port at that time - I have tried re-installing express 2.5.8 and connect 1.7.2 (work on local box) - any insight to troubleshoot the issue more quickly will be greatly appreciated. Once again, the code (using express runs fine on local box - on server, I can run a non express node server on that same port (I close it down before I run the express server instance).
Thanks
Pilot error - the issue was with the redis connection pwd (I had to fix it in my code to match the pwd in the redis.conf to resolve the issue ). Added better handling (which I should have done to begin with).
Thank you Wes for commenting - appreciated.

socket.io example not working - Windows

Im using Node.js 0.6.2 on Windows 7
I managed to get the dependencies solved on Win7 for socket io, now when i launch one of the example apps it doesnt throw any errors.
however, for the IP and listener it reports its listening on , when i launch that in the browser, the connection times out.
Any ideas?
I've tried setting app.listen to different ports and IP addresses, but no luck.
Just for reference, i've tried the famous "hello world" Node.js example which works fine.
Things i've already checked
Other services running on the same ports or same listener IP
Different IP addresses and ports
Firewall / Port blocking
Restarting of the machine
dependencies in node_modules
Different browsers
Telnetting to the listener port (which shows a response so the listener must be working?)
So this works for me (running msysGit and node.js, both latest versions; both Windows installers):
$ cd c:\msysgit\msysgit\cmd
$ git clone git://github.com/ry/node_chat.git
$ cd node_chat
$ "c:\progra~1\nodejs\node.exe" server.js
I can open 127.0.0.1:8001 now and run it. The fact that you have to cd into the directory is a bug in node_chat, same behavior is in OS/X.
I managed to solve this problem with some outside help.
I downloaded Node 0.6.3 which comes with NPM.
I created a test folder and then ran NPM Install socket.io express within the test folder and then tested the example app from the Socket IO website in the how-to-use section.
Socket IO emitted the events fine and it all seems to be working well. Thanks everyone for the help and guidance.

Resources