-
-
Notifications
You must be signed in to change notification settings - Fork 16.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
express breaks http module emulation #2805
Comments
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! |
extend-proto should provide a path to resolving at least part of this. |
This issue does not affect my package anymore |
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?
Can I tell express to base its request object on my object's prototype rather than on http.IncomingMessage?
The text was updated successfully, but these errors were encountered: