I have a service listening on port :3000. However, I would like to change that to port :8080. Unfortunately, the program that I'm running does not allow me to change the listen port.
Is there any way that I could have localhost forward port :3000 to port :8080? So when I connect externally on :8080 it will forward that traffic to :3000?
I tried the socat commnand, but it didn't seem to work.
Edit: I tried the following command (found here). It didn't display anything, but the command kept running. When I tried to open it in Firefox, it just kept loading forever, eventually getting the connection timed out error. In chrome it said that the connection was reset. I apologize if this was me not configuring the command properly, I'm not familiar with socat or networking.
socat tcp-listen:8080,reuseaddr,fork tcp:localhost:3000
Edit 2: I ran nmap on localhost (sshing into the device), scanning for all ports. For some reason, it didn't show port :3000 as open. However, when I used its public IP address rather than localhost, port :3000 showed up. I'm hosting through Linode, if anybody knows why this is happening.
Edit 3: So the port is apparently forwarding properly, because when I use the curl command (using the public IP), it gives me the correct HTML code and an HTTP 200 OK status. But when I try to open it in a browser, I get connection timed out (Firefox) or connection was reset (Chrome). So it seems to be a browser issue. I know I'm trying to connect via HTTPS on port 8080, if that has anything to do with it.
Thanks in advance!