title: How can I manually create http.IncomingMessage stream?
body: <p>I want to manually create http.IncomingMessage stream with some header &amp; body. As it is a readable stream, I can't write/pipe data into it. Is it safe to extend it?</p>
  <p>Also, I am not sure how to store headers when it's a stream which doesn't operate on ObjectMode.</p>
  <p><strong>EDIT:</strong></p>
  <p>According to <a href="https://nodejs.org/api/http.html#http_http_createserver_options_requestlistener" rel="nofollow noreferrer">Node.js documentation</a>, extending http.IncomingMessage is possible.</p>
  <blockquote>
  <p>IncomingMessage &lt;http.IncomingMessage&gt; Specifies the IncomingMessage class to be used. <strong>Useful for extending the original IncomingMessage.</strong> Default: IncomingMessage.</p>
  </blockquote>
  <p>How can I extend it? Its constructor asks for <code>Socket</code> object.</p>