Report this

What is the reason for this report?

I am Getting error when sending https request to my node js server from php

Posted on January 28, 2020

I am Getting error when sending https request to my node js server from php

cURL error 7: Failed to connect to api1.waapi.site port 9000: Connection refused

I am trying to send a request to https://api1.waapi.site:9000.

Please help me.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @mrbarnk,

cURL error 7 is very explicit, it means for some reason you are not able to connect to the provider url. Most of the time it’s related to a firewall or some kind of a restriction issue.

Another suggestion would be that you haven’t started node to actually listen on port 9000. The last suggestion I have is that actually your firewall is blocking the access to this port.

To test the above theories, SSH to your droplet, start your NodeJS instance and type in the following

netstat -tulpen | grep 9000

If you have started the NodeJS application properly, you should see it in the output. If you do, it would mean your firewall is the issue. You’ll need to allow incoming traffic to the mentioned port. To do you need to run

iptables -A INPUT -p tcp --dport 9000 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT

If you don’t see any output, it would mean your NodeJS application hasn’t been started properly.

Regards, KDSys

same error any solution?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.