title: Send the request to next event handler in NodeJS
body: <p>I am trying to create a module which can log some certain params for the request and print them to the page which can be checked online, the page will use the <code>socket.io</code> to load the latest logs.</p>
  
  <p>And I want this module can worked as a plugin which means you just call this module, and initialize it, then an extra entry point <code>/_logger</code> will be added to you application, once you visit the page, the latest logs will be updated in real-time. So the module have to intercept the requests:</p>
  
  <pre><code>function setup(httpServer) {
      //page
      httpServer.on("request", function (request, response) {
          var pathname = url.parse(request.url).pathname;
          if (pathname === '/_logger') {
              fs.readFile(__dirname + '/logger.html', (err, data) =&gt; {
                  response.writeHead(200, { 'Content-Type': 'text/html' });
                  response.write(data);
                  response.end();
              });
          }else{
            // how to give up the control for this requset
          }
      });
  
  
      var io = require('socket.io')(httpServer);
      io.on('connection', function (socket) {
          //TO BE DONE
          socket.on('event', function (data) { });
          socket.on('disconnect', function () { });
      });
  }
  module.exports = {
      setup: setup
  }
  </code></pre>
  
  <p>Usage:</p>
  
  <pre><code>var logger= require("./logger/index");
  var server = require('http').createServer();
  logger.setup(server);
  server.on("request", function(req,res){
    //Normal logic for different application
  });
  server.listen(3333);
  </code></pre>
  
  <p>Now the problem is that once the requested url is  not <code>/_logger</code>, I should release the control of this request.</p>
  
  <pre><code>        if (pathname === '/_logger') {
            //take control
          }else{
            // Nothing should be done here, it should go to the next request chain.
          }
  </code></pre>
  
  <p>After read the documents, I can not find the right way to make it.</p>
  
  <p>Any ideas?</p>