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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-07-2014, 09:00 AM
|
#1
|
Member
Registered: Sep 2005
Posts: 201
Rep:
|
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?
|
|
|
08-07-2014, 09:08 AM
|
#2
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,970
|
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.
|
|
|
08-07-2014, 11:00 AM
|
#3
|
Member
Registered: Sep 2005
Posts: 201
Original Poster
Rep:
|
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.
|
|
|
08-07-2014, 11:42 AM
|
#4
|
Senior Member
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683
|
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
|
|
|
All times are GMT -5. The time now is 11:23 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|