Sometimes you need a service that only listens on localhost to be reachable on another port for a few minutes. socat connects two endpoints and copies data between them, and a TCP port to a TCP port is the classic case.
socat TCP-LISTEN:8080,fork,reuseaddr TCP:127.0.0.1:3000
The left side listens on port 8080 on every address. Each incoming connection is passed to port 3000 on localhost. fork lets socat handle more than one connection, because without it the command exits after the first client leaves. reuseaddr lets you restart it right away instead of waiting for the old socket to clear.
To listen on one address only, add bind:
socat TCP-LISTEN:8080,bind=192.0.2.10,fork,reuseaddr TCP:127.0.0.1:3000
You can check it from the other side with ss -tlnp, which shows socat as the owner of port 8080.
Keep in mind what you just did. A service that was safe on localhost is now open to anyone who can reach that port, with no TLS and no login in between. I’d only use this for short tests and stop it with Ctrl-C afterwards. For something permanent, a real reverse proxy or a firewall rule is the better place. socat also does not log who connects unless you add -v or -d options.
Further reading: socat(1) manual page