Skip to content

Instantly share code, notes, and snippets.

@moffff
Created February 16, 2016 02:22
Show Gist options
  • Save moffff/016b673da83c5452493e to your computer and use it in GitHub Desktop.
Save moffff/016b673da83c5452493e to your computer and use it in GitHub Desktop.
Port Forwarding

You may want to set up /etc/host such that foo.bar resolves to localhost:5000.

sudo ifconfig lo0 10.0.0.1 alias
echo "rdr pass on lo0 inet proto tcp from any to 10.0.0.1 port 80 -> 127.0.0.1 port 5000" | sudo pfctl -ef -

Then, add this to /etc/hosts:

10.0.0.1 foo.bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment