Unity ships sockpol.exe for Windows, and that can be run on Mac with "mono sockpol.exe", but Linux servers are omitted. Presumably they figured if you ran a Linux server you'd know how to do it. Well I didn't, and couldn't find it, so I'm going to answer my own question, because I think it will be useful, and would love it if someone had a better idea.
You can use netcat (a.k.a. nc) to listen on a socket and respond to requests. Basically you just create a script that pipes an echo of the domain policy to nc. e.g., create a text file that will be your script, say, domainPolicyServer.sh:
#!/bin/sh
while true; do echo '<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*" to-ports="1-65536"/>
</cross-domain-policy>' | netcat -l 843; done
You'll need to make it executable, and you'll probably want to make sure no one messes with it, e.g.
chmod 700 domainPolicyServer.sh
You can then start that with:
/path/to/file/domainPolicyServer.sh > /dev/null &
That will start it in the background and keep it quiet.
You can also add that command to your /etc/rc.local to ensure it is started at boot up.
This works, but I'm no Linux guru, so feedback is welcome.
There is an issue with this script becoming unresponsive and stopping responding to tcp requests. The script is still running but with no clue to why it’s not responding.,There is an issue with this script becoming unresponsive and stopping reponding to tcp requests. The script is still running but with no clue to why it’s not responding.