Skip to content

Instantly share code, notes, and snippets.

@porn
Created September 25, 2020 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save porn/7896858125d31f857639e24b9940f282 to your computer and use it in GitHub Desktop.
Save porn/7896858125d31f857639e24b9940f282 to your computer and use it in GitHub Desktop.
redirect local 443 requests to another port
# after this commnad you can query https://localhost which will actually serve https://localhost:4200
sudo iptables -t nat -A OUTPUT -s localhost -p tcp --dport 443 -j REDIRECT --to 4200
# to view the rules
sudo iptables -L -t nat
# to remove the rule:
sudo iptables -t nat -D OUTPUT -s localhost -p tcp --dport 443 -j REDIRECT --to 4200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment