I wanted to rewrite ports on incoming tcp packets (on OSX) on my host machine, so that a web server on a guest vm appears to be running on the host.
Incoming packets on port 80 should get rewritten to 8080, and incoming packets on port 443 should get rewritten to port 8443.
I asked about this on hipchat a few days ago and nobody seemed to know the answer - I recently found it, and so decided to share in case this is useful to anybody.