title: socat fake http server - use a file as server response
body: <p>I've been trying to use socat to respond on each connection to a socket it's listening to with a fake HTTP reply. I cannot get it working. It might be because I'm using the cygwin version of socat? I don't know.</p>
  
  <p>Part of the problem is I want the second argument <code>&lt;some_file_response&gt;</code> not to be written to. In other words because it's bidirectional it will read what's in response.txt and then write to that same file, and I don't want that. Even if I do <code>open:response.txt,rdonly</code> it doesn't work repeatedly. <code>system:</code> doesn't seem to do anything. <code>exec</code> seems like it works, for example I can do <code>exec:'cat response.txt'</code> but that never gets sent to the client connecting to port 1234.</p>
  
  <pre><code>socat -vv tcp-listen:1234,reuseaddr,fork &lt;some_file_response&gt;
  </code></pre>
  
  <p><em>I want it to read a file to the client that's connected and then close the connection, and do that over and over again (that's why I used fork).</em></p>
  
  <p><strong>I am putting a bounty on this question. Please only give me solutions that work with the cygwin version from the windows command prompt.</strong> </p>