Proxy Tunneling Through SSH - linux

We have an HTTP proxy available on our facility's intranet. The proxy is accessed through a local IP address (192.168.x.x) and cannot be accessed from outside.
I can connect to a head node on the intranet through SSH, which has a public IP address. I can expose any port I'd like on this node.
Is there a way to somehow forward the traffic from an exposed port on the head node to this local proxy and back out to the world? I've been looking up this problem, but most solutions can only relay the traffic via SSH Port Forwarding to a local port on the device with SSH access, not another device with a different IP address.

You can try from a machine on the Internet :
ssh -L 3128:proxyIp:proxyPort user#headNode
Then on that machine, you can use localhost:3128 as proxy.
Try on a machine inside intranet first to make sure there is not security implications.

Related

Webserver not accessible on port 8080 after configuring Proxy

Let me start by saying I'm very new to this:
We have a linux server behind secure environment (No internet access). I was running apache webserver on that machine in port 8080 and it was accessible within the company network. Recently we asked networking team to configure us Proxy address so that the server can access Internet to perform yum, wget and few other maintenance related task.
The networking team configured http and https proxy on port 8080 and gave us a proxy address to use (http://someproxyaddress.com:8080). Now the port 8080 is connected to proxy server and apache service has been kicked out from that port. hence, it's unreachable. what kind of configuration changes do I have to make so I can access the apache web server from another machine within the company?

Change NodeJS local server access URL

Is it possible to change the URL used to access my local NodeJS server?
For instance, I have a Node server running on port 3000, so I can access this server directly through:
http://localhost:3000/
And other users on my network can access it through:
http://[MY_IP_ADDRESS]:3000/
Is it possible to forward this server to a local URL, like http://example/
I know that, in order to remove the port from the URL I need to bind the app on port 80, but I can't find anything about changing de URL.
Not very clear what you want, to be honest and your set-up. You use local computer or server in local network?
If you want URL in your local network isolated - that's not possible hence the URL protocol forwards requests from domain name to certain ip address.
If you want only internal access in your local network you only need to know your local ip address and make sure your firewall allows local connections. Depending on your OS run ip check in cli and voila - that's your ip.
If you want external connections then you need to have a static ip address which you should obtain from your internet provider and afterwards you need to alter you router settings and set up port-forwarding to your local machine. It will then listen to external connections on certain port and forward it to your local machine where nodejs listens (itself or through web-server). Here you can redirect your domain URL name via A-record to your static ip address of your router and port-forward to local machine.
Check out this guide for most routers for external port-forwarding.
UPD: checkout this answer

How to allow extern access with node.js

How can I allow other users to access my application that is running on localhost? Is there any package in the npm that facilitates this access?
To access your localhost (on a home network) from the internet, you need to provide a couple things.
You need a way for your clients to contact your server. This can either be via an IP address http://xxx.yyy.xxx or a domain name http://somedomain.com/whatever. If it's an IP address, then it needs to be a public IP address (not a local network address). For a home network, you would typically use the public IP address of your router that is how you connect to the internet.
If you are going to use a domain name, then you need to actually choose a domain name, register it with a registrar and configure it to point to your router's public IP address.
If your router does not have a static IP address, then you will likely need to use a dynamic DNS service that will automatically update your DNS entry to point to your dynamic IP address whenever (or if ever) it changes. There are lots of dynamic DNS services.
Then, you need to create a "hole" in your router's firewall so that incoming connections to port 80 are port forwarded to the computer where your server is running. This will typically be done in the router's configuration/security administration UI. You will "port forward" and incoming request on port 80 to whatever IP and port your server process is running on your local network.
For a more durable server installation, you would do the following:
Buy a hosting package at a hosting site that hosts the type of application you are running at the scale you expect to run it at (storage, CPUs, bandwidth). In your case, you'd be looking for a hosting service for node.js apps.
Then, you'd buy a domain name and configure it to point to the public IP address that your hosting provider gave you for your server.
Then, you'd install your server app at the hosting site and run it according to the hosting provider's instructions.
Then, a user can access your server via an URL using your public domain http://somedomain.com/whatever.
You can do so by using ngrok. In your command prompt type npm install ngrok. Once installation finished restart your command prompt and type ngrok http 3000, here 3000 is the port on which your server is running. You will get something like http://ee309.ngrok.io which is your temporary domain. You can use it until you shut your system down or close command prompt.

Getting the ip address automatically on localhost using trust proxy

I have enabled trust proxy option to get the ip adress of the remote client. When the application is deployed on a remote server then I get the right address from req.ip but when the application runs on localhost then I get this address ::ffff:10.0.2.2. Does it exist a way to make thing work both in localhost and in the remote?

Windows XP exposing websites in IIS in local network

how can I expose my Website to other PC's in my local network? Say I my computer name is CompTest and I can access my websites deployed in IIS in my own machine in http://Comptest/ and http://localhost/. Is there anything I need to set so other computers in my local network can access http://CompTest/? Just within local network.
You need to enable HTTP (port 80) over TCP through the Windows Firewall (in the Control Panel).
try using your ip address rather the your host name. like http://[ip address]:[port no]/[site name]. for your info http port is 80. also do
disable firewall
use static ip
i hope this will help you

Resources