title: how to feed a file to telnet
body: <p>trying to understand http and headers i was playing around with telnet to send requests. to not type everything again and again and again i thought i'd write a small textfile with all the commands i need.</p>
  
  <p>my file is as simple as follows:</p>
  
  <pre><code>GET /somefile.php HTTP/1.1
  Host: localhost
  </code></pre>
  
  <p>i then try to feed it to telnet with io-redirection:</p>
  
  <pre><code>$ telnet localhost 80 &lt; telnet.txt
  </code></pre>
  
  <p>but all output i get is</p>
  
  <pre><code>Trying ::1...
  Connected to localhost.
  Escape character is '^]'.
  Connection closed by foreign host.
  </code></pre>
  
  <p>what am i doing wrong?</p>