I am running macOS Mojave 10.14.6.
I have an app that is looking for a service hosted on localhost:9999, but I am hosting this service on a different server at 12.3.4.5:8000. How can I setup firewall rules, dns rules, or some other option, in order to redirect all requests to localhost:9999 on my machine to go to 12.3.4.5:8000?
I found many questions asking how to redirect requests to a domain to localhost, but that is the opposite of what I am looking for. I want to redirect requests from localhost to a domain (or ip):
I found this question when searching but it is not the same question as I am asking: Can I specify a port in an entry in my /etc/hosts on OS X? I also tried to use ifconfig and pfctl as in this answer to fit my case but I was unable to make it work: iptables equivalent for mac os x