Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
express breaks http module emulation #2805
I'm the developer of node-fastcgi. My module emulates the api of node's http module to host standard http applications on fastcgi.
Since version 4 express replaces the request object prototype with its own implementation (in express/lib/middleware/init.js). This breaks the implementation contained in node-fastcgi which is not based on http.IncomingMessage (as seen in issue fbbdev/node-fastcgi#4).
Any tips you can give me to work around this problem?
Hi @fbbdev ! This has been an issue with all versions of Express (in versions prior to 4.0, this replacement was done in the
We have been looking into the best solution for a few months now and are trying to work towards a solution. The main problem is Express' design: it was designed to be just a thin layer on top of the Node.js core HTTP server, thus it heavily integrates itself and depends on the internal working of the
You can, as a global Express option, though how much this will break Express internals (the
var express = require('express') var fcgi = require('node-fastcgi') express.request.__proto__ = fcgi.Request.prototype express.response.__proto__ = fcgi.Response.prototype
Other solutions involve avoiding Express 4.x for the time being and using it's components like the
We want to find solution solution for Express 5.x, so if you would like, thinking about something, providing a PR, etc, would be awesome!