Wikipedia has a one-liner:<p><pre><code>     { echo -ne &quot;HTTP&#x2F;1.0 200 OK\r\nContent-Length: $(wc -c &lt;some.file)\r\n\r\n&quot;; cat some.file; } | nc -l -p 8080
</code></pre>
<a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Netcat" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Netcat</a>