title: C# Socket Policy File Server for low-level AS3.0 socket connections?
body: <p>How do I go about making a socket policy file server in C#. All it has to do is listen on port 843 for the string "&lt;policy-file-request/&gt;" followed by a NULL byte and then return an XML string (which is the socket policy file).</p>
  
  <p>I haven't coded this sort of thing before and am unsure of where to start. Do I create it in a windows service? Any tips or links are welcome.</p>
  
  <p>Background:</p>
  
  <p>To contact a web service from flash I am using the 'as3httpclient' library instead of the URLRequest/URLLoader. This is because it gives me the ability to send custom headers with GET requests. This library uses low-level sockets to do its stuff.</p>
  
  <p>When flash uses low-level sockets to connect to a server it looks for a socket policy file - and this needs to be served up by a socket policy file server.</p>
  
  <p><a href="http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html" rel="nofollow noreferrer">Socket Policy File Article from Adobe</a></p>