LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-07-2014, 09:00 AM   #1
Geminias
Member
 
Registered: Sep 2005
Posts: 201

Rep: Reputation: 30
How to proxy 0.0.0.0:5000 to localhost:portNum


I have a vagrant development environment which I am trying to setup remote debugging on. The trouble is that the debug port is bound to localhost, not 0.0.0.0, so I cannot connect to it from my host machine.

There must be a simple command in linux to tell the system the following:

"Dear good OS sir, when you see a connection from the outside world on 0.0.0.0:5000 please relay that traffic to localhost:4444"

Effectively creating a local proxy to a different port bound on a different network interface.

Can any of you you wizards help me out?
 
Old 08-07-2014, 09:08 AM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,970
Blog Entries: 4

Rep: Reputation: 4027Reputation: 4027Reputation: 4027Reputation: 4027Reputation: 4027Reputation: 4027Reputation: 4027Reputation: 4027Reputation: 4027Reputation: 4027Reputation: 4027
Okay, "localhost" is an IP-address corresponding to "this machine," and 127.0.0.1 should always get you there. I'm no familiar with using an all-zeros address in that way, and would intuitively expect "anything all-zero" to be taken as NULL.

Anyhow, the command you might be looking for is route. (Read the man-page.)

You might also be looking at something that iptables can do, especially since you're talking about "the outside world."

Also ... I would be extremely reluctant about directing something "from the outside" to something that would be "from the inside." Really, what you should be doing – and what, I am quite certain, the remote-debugger software will be doing – is to be listening directly to that "outside world" port.

Thus, I'm going to offer the suggestion that what we have here is an "XY Problem." You've identified something that's wrong ("the remote-debugger software isn't listening"), and you've identified a strategy and now you are pursing it. I'd suggest stepping back now, take a careful look at the whole problem again, and consider other strategies. That remote-debugging server/client should not be listening to localhost, although maybe it defaults to it. The true cause here is probably an incorrect configuration command. (Check the logs... did the software perhaps find a "tpyo" somewhere in the config, log it out, default(!) to localhost on the assumption that you're just kicking the tires, and so 'start anyway?') Betcha...

Last edited by sundialsvcs; 08-07-2014 at 09:12 AM.
 
Old 08-07-2014, 11:00 AM   #3
Geminias
Member
 
Registered: Sep 2005
Posts: 201

Original Poster
Rep: Reputation: 30
Hey Thanks Sundial, I appreciate it. I happen to know for a fact that Node.js when run with the debug option only runs on localhost and cannot be accessed from the outside world.

In the documentation of my IDE where it tells me how to do remote debugging against a node instance, it specifically says to set up a proxy if it is on a remote machine so that you can access it. But it refuses to go into detail about how to setup the proxy.
 
Old 08-07-2014, 11:42 AM   #4
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
if something is listening on 0.0.0.0:5000
that means it will listen on *all* interfaces

e.g.

127.0.0.1:5000
192.168.0.100:5000


lets pretend you have squid listening on 0.0.0.0:5000 ( on the 192.168.0.100 machine )

if you setup the web browser ( running on same machine ) as 127.0.0.1:5000 , you will be talking to squid
if you have a machine ( 192.168.0.101 ) , and want to use that same squid proxy, 192.168.0.100:5000

if you tried to setup 192.168.0.101 with proxy 0.0.0.0:5000 , it will try all local interfaces ( e.g. 127.0.0.1:5000, 192.168.0.101:5000 )

Not what you want
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mail received at sendmail has relay=localhost [[UNIX: localhost]] check_rcpt fails chingupt Linux - Distributions 3 04-25-2013 06:36 PM
I need help: Squid blocking my http://localhost or my IP proxy server. megaweak Linux - Server 1 10-25-2012 05:05 PM
I don't understand this line ->>> delay_parameters 2 5000/150000 5000/120000 manalisharmabe Linux - Newbie 6 05-17-2011 07:27 AM
Error parsing proxy URL http://localhost:4001 : Bad port number? lugoteehalt Linux - Networking 1 11-20-2009 07:58 PM
Message from syslogd@localhost localhost kernel: Disabling IRQ #21 ylts Linux - Hardware 0 02-26-2005 09:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:23 AM.

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