Last active
March 9, 2018 02:37
-
-
Save sbolel/db5ad50c3f72c6a18ab6c7e7a924dcb9 to your computer and use it in GitHub Desktop.
pfctl hack: forward localhost port to another port
This file contains 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
#!/usr/bin/env bash | |
# forward localhost:8000 to localhost:3000 | |
echo "rdr pass on lo0 inet proto tcp from any to 127.0.0.1 port 8000 -> 127.0.0.1 port 3000" | sudo pfctl -ef - | |
# remove it | |
sudo pfctl -F all -f /etc/pf.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment