2

Have this setup:

  • expressjs server started from one node process, listening to port 8081.
  • js client trying to make a request to it from another node process, using node's http module.
  • client failing with 400 error.
  • same URL (http://localhost:8081/) is opening in browser just fine.

Spent a few hours trying to troubleshoot it, then tried to change the port and it worked. Turns out there is another process listening on port 8081:

$ lsof -i tcp:8081                                        
COMMAND    PID            USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
EUSAManag 1187 oleksandr.suhak    4u  IPv4 0xce3bb9546cff3ab1      0t0  TCP localhost:sunproxyadmin (LISTEN)

(Have no idea what EUSAManag is)

I guess my question is: how could it be that the express server starts fine without complaining to a "port being used by another process" when the port is clearly in use. And why does it work then when accessing it from the browser, but does not work when making request from js client? Any tips on figuring out what is actually happening here?

  • 1
    Regarding the used port/service, this might be related: https://stackoverflow.com/q/49877762/3761628, still very weird that your express app is able to start though.. – eol Dec 06 '21 at 20:00

1 Answers1

1

If guess that EUSAManager.exe come from one of software https://iit.com.ua/downloads which is in the business of information security. Most likely their software interfere too much with you operation system.

codevision
  • 5,165
  • 38
  • 50