Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-28-2014, 09:58 AM   #1
LQ Newbie
Registered: Nov 2014
Posts: 1

Rep: Reputation: Disabled
Nodejs remote debugging ports closed

I have a problem with nodejs remote debugging. I'm using centos on remote server and phpstorm on my PC. When I open putty: I type in command:

node --debug-brk=5858 main_server.js,

and the output is:

debugger listening on port 5858.

Next thing I do is go to edit configuration in phpstorm, and choose remotehost:8585. When I'm trying to connect, it pops up:

connecting to remoteserver:8585

connection refused.

What I have done so far is to add port 8585 and 5858 to centos firewall with adding lines to iptables:

-A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 5858 -j ACCEPT

-A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 8585 -j ACCEPT

After that I tried another solution, because I saw in documentation that I need to set up port forwarding:

yum install balance -yt

balance -df 8585

and tried port forwarding with this command

iptables -t nat -A PREROUTING -p tcp -m tcp -i eth0 --dport 5858 -j DNAT --to

The solutions I tried were: and

I also opened ports on my local network router and Windows firewall, but I don't know if I have a good logic. What is detailed procedure for enabling nodejs remote debugging on centos server, which ports do I need to open, where exactly (remote server and LAN), do I need port forwarding, and what I need to do in order to make nodejs remote debugging work?
Old 12-26-2014, 07:30 AM   #2
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590
I'd say just remove the firewall rules you added, establish a SSH tunnel to the host and reach port 5858 via localhost.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't SSH to remote machine: Connection closed by remote host Avatar Linux - Networking 35 10-23-2017 01:21 AM
[SOLVED] nodejs, nodejs-dev incompatibility in Ubintu? mjbradakis Linux - Software 1 03-25-2013 12:50 AM
Closed Ports? ZingSter Linux - Software 1 01-21-2005 01:08 PM
Help getting my ports filtered/closed.... BmxFace Linux - Security 3 02-04-2004 12:07 PM
Closed ports? Greg21 Linux - Networking 4 01-15-2002 12:37 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:28 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration