Created
July 11, 2020 18:19
-
-
Save rafamdr/4a8590fce9ecd1068d1fd19ae5287bd7 to your computer and use it in GitHub Desktop.
Redirect local service with specific port using a public port
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Two examples (TCP and UDP) showing how to redirect traffic to private ports (6120, 6121) used by a local service, | |
| # using public ports (8000, 8001). | |
| # Bonus: if your application/service has IP address or DNS name filtering, in this case, using this approach, | |
| # it will understand that all requests are coming from "localhost" | |
| socat tcp-listen:8001,reuseaddr,fork tcp:localhost:6121 | |
| socat udp-listen:8000,reuseaddr,fork udp:localhost:6120 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment