Described in the previous article, You can add a record in the local hosts file to resolve the local 127.0.0.1 of the trusted domain name in the public number, but Tomcat does not start on the non-root 80 port of the Mac, so we can use Pfctl port forwarding to forward the request on the local 80 port to port 8080, for example, by 80-port access.
Note: Mac OS uses port 80 for network file sharing and needs to be shut down first.
I. Modification of/ETC/PF.CONF
The pf.conf is backed up first: Cp/etc/pf.conf/etc/pf.conf.normal.bak, followed by the following line in the file:
" com.apple/* "
Add a line of configuration later, as follows:
127.0. 0.1 the 127.0. 0.1 8080
PS: Lo0 through ifconfig see oneself that device binds is 127.0.0.1, Lo0 is the name of this network device
Second, execute the following command in turn:
sudo pfctl-dsudo pfctl-f/etc/pf.conf sudo pfctl-e
Note in particular: If you have a server such as Apache that occupies 80 ports, you need to stop it to succeed!
This port forwarding configuration is successful, the next one will explain how to turn port forwarding on and off into two script files, each time sudo runs the two scripts can be easily turned on and off.
Fullstack.yang
2016-12-26 Tianfu Software Park in Chengdu High-tech Zone
How to carry out port forwarding under Mac for a series of debugging tasks that require the use of port 80