Hi everyone, for some reason my node.js app is not able to connect to an IP address after I deployed it to digital ocean. My app is supposed to connect to physical alarm systems via IP/Port to get the system status (armed/disarmed). UFW is currently inactive. My app is working locally. Is there something I need to configure in order to get it to connect from the digital ocean servers?
const client = new ElkClient({
connection: {
host: "IP/DNS ADDRESS",
secure: true/false,
port: PORT,
site: "SITENAME"
}
})
console.log(client)
client.connect().catch((err)=> console.log("Connection Error"))
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!
You can try and allow the port through your IPtables. I believe it will still need to be edited even if you are not using UFW.
First to allow incoming connections from this port (only if needed):
sudo iptables -A INPUT -p tcp --dport XXX -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A OUTPUT -p tcp --sport XXX -m conntrack --ctstate ESTABLISHED -j ACCEPT
Where you’ll need to change XXX with your actual port.
Now for outgoing connections, you’ll need to execute the following:
sudo iptables -A OUTPUT -p tcp --dport XXX -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A INPUT -p tcp --sport XXX -m conntrack --ctstate ESTABLISHED -j ACCEPT
Again change XXX with the actual port.
Just out of curiosity, which port are you trying to connect to?
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.