title: Why is "fork" needed by socat when connecting to a web server?
body: <p>I am trying to understand tcp connections between a browser and a web server.  I have a web server running on my local machine, and can browse to it just fine, as expected, using localhost:3000 or 127.0.0.1:3000.  (I am running "rails s"and WEBrick.)</p>
  
  <p>I wanted to put a software intermediary between the browser and the web server, and so began experimenting with socat.  The following works just fine:</p>
  
  <pre><code>socat TCP-LISTEN:8080,fork TCP:localhost:3000
  </code></pre>
  
  <p>I can browse to localhost:8080 and things work as expected.  However, if I omit the ",fork" argument like so,</p>
  
  <pre><code>socat TCP-LISTEN:8080 TCP:localhost:3000
  </code></pre>
  
  <p>the local rails web site is quite broken looking in the browser.</p>
  
  <p>Why is that fork argument necessary?  Why wouldn't a browser &lt;--> web server connection work without it?</p>