I need some.domain.com:8000 to be linked to 162.251.150.150:80.
So when I load some.domain.com:8000 in my browser - an actual request should be going to 162.251.150.150:80.
I was trying to use pf.conf for that with different settings, but without success:
pass out proto tcp from some.domain.com port 8000 to 162.251.150.150 port 80
nat pass on lo0 inet proto tcp from any to some.domain.com port 8000 -> 162.251.150.150 port 80
(I've created an alias for some.domain.com in hosts file along with that)
I have MacOS 10.12.3
p.s. I made that working in Ubuntu with following command:
sudo iptables -t nat -A OUTPUT -p tcp --dport 8000 -d some.domain.com -j DNAT --to-destination 162.251.150.150:80
p.p.s. I saw following question
What is the modern way to do port-forwarding on El Capitan? (forward port 80 to 8080)
My question is specific because of domain name need to be specified
rdr pass log on lo0 proto tcp from en1 to 10.0.0.1 port 8000 -> 162.251.150.150 port 80
– andrfas Feb 27 '17 at 22:45pass out on en1 route-to lo0 proto tcp from en1 to 10.0.0.1 port 8000 keep statewith some.domain.com linked to 10.0.0.1 in hosts file - didn't work. Could you please help me? (edited - didn't finish comment)