title: How to process a net.Stream using node.js?
body: <p>I am trying to learn about streams in node.js!</p>
  
  <h3>server.js</h3>
  
  <pre class="lang-js prettyprint-override"><code>var net = require("net");
  
  var server = net.createServer(function(conn) {
  
    conn.write("welcome!");
  
    # echo the user input!
    conn.pipe(conn);
  });
  
  server.listen("1111", function() {
    console.log("port 1111 opened");
  });
  </code></pre>
  
  <h3>telnet test</h3>
  
  <p>The server currently echos the user's input</p>
  
  <pre class="lang-none prettyprint-override"><code>$ telnet localhost 1111
  welcome!
  hello
  hello
  </code></pre>
  
  <h3>desired output</h3>
  
  <p>To demonstrate where/how I should process the stream on the server side, I would like to wrap the user's input in <code>{}</code> before echoing it back</p>
  
  <pre class="lang-none prettyprint-override"><code>$ telnet localhost 1111
  welcome!
  hello
  {hello}
  </code></pre>