PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, February 17, 2022

[FIXED] Nodejs : Error get/response localhost

 February 17, 2022     cakephp, localhost, mamp, node.js     No comments   

Issue

I'm running a Cakephp app with MAMP on localhost at port 80. I've also Node.js who listen/write on port 4000 with a js script from the Cake app (localhost/client).

When I call Node from js app, it works.

But, when I try to call a Cakephp page (localhost/saveData/123) from Node by http.get(); oder http.request for saving data in database, it crash.

events.js:71 throw arguments[1]; // Unhandled 'error' event ^ Error: connect ECONNREFUSED at errnoException (net.js:770:11) at Object.afterConnect [as oncomplete] (net.js:761:19)

Oder

problem with request: connect ECONNREFUSED

I've test width www.google.com, it works. It seems that's the problem is about "localhost".

Could someone help me? :)

EDIT : I've try with 127.0.0.1 too but it doesn't work (for MAMP and Node).

PS : sorry for my english, i'm french :)


Solution

Probably you have a local webserver running on port 80. Also programs like Skype can be connected to the port 80.

You can try close Skype and/or Webserver (XAMPP, WAMPP, usbwebserver, etc...).

Listing ports in Cmd.exe

$ netstat -a



Answered By - Ron van der Heijden
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing