MacOS Loopback Address Whitelisting
Opened this issue · 2 comments
MacOS by default only whitelists the 127.0.0.1
loopback address. This is a problem as we use loopback addresses in the range of 127.x.x.2
for the proxy tool, with one IP corresponding to one game world.
Without whitelisting these addresses, the clients will be unable to communicate with the proxy tool after being patched, rendering the entire process non-functional.
In order to remedy this problem, we need to write a script that can whitelist all the loopback addresses from world 301 up to around 600 - effectively every world that exists in Old School RuneScape. Because this process is only done once (until a reboot occurs), we need to secure all the existing worlds and give some headroom for new worlds that might be added as well.
The problem with whitelisting these loopback addresses is that they require sudo
privileges - this is likely not something the proxy tool will have. The current best plan forward is to do these steps:
- Launch the HTTP server when the proxy tool boots up.
- If the operating system is MacOS, attempt to ping the HTTP server on. If the ping is successful, do nothing - the addresses have been whitelisted. If it isn't successful, go to step 3.
- Launch a modal window asking the user for the
sudo
password, with an explanation for why this is necessary. - Once the
sudo
password has been acquired, run the script withsudo
privileges, whitelisting all the loopback addresses that we'll need. - Restart the HTTP server - it is unclear whether this is necessary, but it probably is.
The command to whitelist a loopback address is sudo ifconfig lo0 alias 127.x.x.2
.
Probably just providing a script to run would work. I think if someone is messing with rsprox they will know how to run a script. Add a line to the setup instructions for mac users.
BTW thanks for the post, this got my rsprox working.
Probably just providing a script to run would work. I think if someone is messing with rsprox they will know how to run a script. Add a line to the setup instructions for mac users.
BTW thanks for the post, this got my rsprox working.
I came up with a script that registers all the possible aliases, but in my limited testing it made the general networking of my machine super slow and also doesn't persist across reboots which is far from ideal.