Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add UWS_HTTP environment variable #3206

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ app.render = function render(name, options, callback) {
*/

app.listen = function listen() {
var server = http.createServer(this);
var server = process.env.UWS_HTTP ? require('uws').http.createServer(this) : http.createServer(this);
return server.listen.apply(server, arguments);
};

Expand Down
2 changes: 1 addition & 1 deletion lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var proxyaddr = require('proxy-addr');
*/

var req = exports = module.exports = {
__proto__: http.IncomingMessage.prototype
__proto__: process.env.UWS_HTTP ? require('uws').http.getRequestPrototype() : http.IncomingMessage.prototype
};

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var vary = require('vary');
*/

var res = module.exports = {
__proto__: http.ServerResponse.prototype
__proto__: process.env.UWS_HTTP ? require('uws').http.getResponsePrototype() : http.ServerResponse.prototype
};

/**
Expand Down