Running sockpol.exe on linux

Hi, I need to run the domain policy server in a linux environment (so my browser build can connect). Up to now I have been using the solution that others have posted, which is based on a shell script. I modified slightly to run on RHEL5:

#!/bin/sh
while true; do echo '<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*" to-ports="1-65536"/>
</cross-domain-policy>' | nc -l 843; done

I’m not sure why, but for me this seems to work for a while, but eventually stall. The only way I can get to work again is to kill process and the nc process, and restart the script. I thought I would try installing mono and running the sockpol.exe that’s provided with unity. This solution works if I run it from an ssh terminal:

mono sockpol.exe --all

However, closing the terminal shuts it down. I assumed that doing the following would work:

mono sockpol.exe --all > /dev/null

However, when I run it this way the domain policy server seems to not respond. Can anyone shed some light on what I’m doing wrong??

I figured out the problem. Basically in sockpol.cs, it makes a call to Console.ReadLine(), looking for a key press to end the application. For some reason RHEL5 doesn’t like this. So I replaced the following in sockpol.cs:

//Console.WriteLine ("Hit Return to stop the server.");
//Console.ReadLine ();
//server.Stop ();

// Never end
while(true);

Recompiled, added to rc.local, and now it starts when the server starts, and is working for now. Hopefully I don’t run into the same issue of it stalling out after some time.