Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
04b5ac0
Add files via upload
julianwoolston Nov 14, 2018
d1def5d
Add files via upload
julianwoolston Nov 14, 2018
bf6167f
Update to support node v8, v9 and v10.
julianwoolston Nov 14, 2018
a9eaa6c
Update to support node v8, v9 and v10.
julianwoolston Nov 14, 2018
af0fd8f
Update to support node v8, v9 and v10.
julianwoolston Nov 14, 2018
cdc1bcc
Update to support node v8, v9 and v10.
julianwoolston Nov 14, 2018
e0c461c
Update to support node v8, v9 and v10.
julianwoolston Nov 14, 2018
474632f
Update to support node v8, v9 and v10.
julianwoolston Nov 14, 2018
fedf7de
Update binary
julianwoolston Nov 14, 2018
cbfab70
Update binary
julianwoolston Nov 14, 2018
54dcf77
Update binary
julianwoolston Nov 14, 2018
bd2b94f
Update binary
julianwoolston Nov 14, 2018
64ac9a6
Update binary
julianwoolston Nov 14, 2018
3a3a8c7
Update binary
julianwoolston Nov 14, 2018
9b6e8d9
Update binary
julianwoolston Nov 14, 2018
f3c3a22
update binary
julianwoolston Nov 14, 2018
86f5333
Update binary
julianwoolston Nov 14, 2018
99c96a9
Update binary
julianwoolston Nov 14, 2018
c1912e7
Update binary
julianwoolston Nov 14, 2018
76222bb
Update to support node v8, v9 and v10
julianwoolston Nov 14, 2018
1290b79
Update to support node v8, v9 and v10.
julianwoolston Nov 14, 2018
be7ab0a
Update to support node v8, v9 and v10.
julianwoolston Nov 14, 2018
827412a
Update to support node v8, v9 and v10.
julianwoolston Nov 14, 2018
39ae23d
Update to support node v8, v9 and v10.
julianwoolston Nov 14, 2018
241c513
Update to support node v8, v9 and v10.
julianwoolston Nov 14, 2018
0b27820
Update to support node v8, v9 and v10.
julianwoolston Nov 14, 2018
2c7f037
Update to support node v8, v9 and v10.
julianwoolston Nov 14, 2018
65d8d4d
Update to support node v8, v9 and v10.
julianwoolston Nov 14, 2018
92765e8
Update to support node v8, v9 and v10.
julianwoolston Nov 14, 2018
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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Compared to the built in HTTP[S] stack in Node.js, the httpsys module offers:

### Compatibility

The httpsys module requires Windows. It works with any stable version of Node.js, both 32- and 64-bit. The module was developed and tested with Node.js 0.6.20, 0.8.22, 0.10.15, each in 32 and 64 bit flavors.
The httpsys module requires Windows. It works with any stable version of Node.js, both 32- and 64-bit. The module was developed and tested with Node.js 8.9.4, 9.9.0, 10.13.0, each in 32 and 64 bit flavors. As it makes use of Native Abstractions (nan) for Node.js it should build for other versions of node.

WebSockets functionality requires Windows 8 or Windows Server 2012 or later.

Expand All @@ -24,7 +24,7 @@ Any and all feedback is welcome [here](https://github.com/tjanczuk/httpsys/issue

### Getting started

You must have Windows and a stable version of Node.js installed (0.6, 0.8, 0.10). Then:
You must have Windows and a recent version of Node.js installed (8, 9, 10). Then:

```
npm install httpsys
Expand Down Expand Up @@ -217,9 +217,9 @@ The httpsys module exposes the following functions:

### Building

To build httpsys, you must have Visual Studio 2012 or Visual Studio Express 2012 for Windows Desktop. There are a few ways to build depending on what you want to achieve.
To build httpsys, you must have Visual Studio 2015 or Visual Studio Express 2015 for Windows Desktop. There are a few ways to build depending on what you want to achieve.

To build httpsys for all supported versions and flavors of Node.js: (0.6.20, 0.8.22, 0.10.15) x (x32, x64), call
To build httpsys for all supported versions and flavors of Node.js: (8.9.4, 9.9.0, 10.13.0) x (x32, x64), call

```text
tools\buildall.bat
Expand Down
23 changes: 13 additions & 10 deletions binding.gyp
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
'targets': [
{
'target_name': 'httpsys',
'sources': [
'src/httpsys.cc'
]
}
]
}
{
'targets': [
{
'target_name': 'httpsys',
'sources': [
'src/httpsys.cc'
],
"include_dirs": [
"<!(node -e \"require('nan')\")"
]
}
]
}
126 changes: 126 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
var version = require('./package.json').version
, httpsys = require('./lib/httpsys_native')
, HttpServer = require('./lib/HttpServer')
, HttpsServer = require('./lib/HttpsServer')
, Server = require('./lib/Server')
, ServerRequest = require('./lib/ServerRequest')
, ServerResponse = require('./lib/ServerResponse')
, util = require('util');

httpsys.httpsys_init({
initialBufferSize: (+process.env.HTTPSYS_BUFFER_SIZE) || 16384,
requestQueueLength: (+process.env.HTTPSYS_REQUEST_QUEUE_LENGTH) || 5000,
pendingReadCount: (+process.env.HTTPSYS_PENDING_READ_COUNT) || 1,
cacheDuration: isNaN(process.env.HTTPSYS_CACHE_DURATION) ? -1 : (+process.env.HTTPSYS_CACHE_DURATION),
callback: Server._dispatch
});

function addClientStack(target, source) {
[ 'STATUS_CODES',
'IncomingMessage',
'OutgoingMessage',
'Agent',
'globalAgent',
'ClientRequest',
'request',
'get',
'Client',
'createClient'
].forEach(function (api) {
if (source[api])
target[api] = source[api];
});
}

var http;
var https;

exports.http = function () {
if (!http) {
http = {
Server: HttpServer,
ServerRequest: ServerRequest,
ServerResponse: ServerResponse,
createServer: function (requestListener) {
var server = new HttpServer();
if (requestListener) {
server.on('request', requestListener)
}

return server;
},
httpsys_version: version
};

addClientStack(http, require('http'));
}

return http;
};

exports.https = function () {
if (!https) {
https = {
Server: HttpsServer,
createServer: function (options, requestListener) {

// `options` are ignored for API compatibility
// Keys and certificates in HTTP.SYS
// are configured with `netsh http add sslcert`.

var server = new HttpsServer();
if (requestListener) {
server.on('request', requestListener)
}

return server;
},
httpsys_version: version
};

addClientStack(https, require('https'));
}

return https;
}

exports.http.slipstream = function () {
// Make sure original HTTP module is loaded into native module cache
module = require('http');
module.createServer = function (requestListener) {
var server = new HttpServer();
if (requestListener) {
server.on('request', requestListener)
}
return server;
}

module.Server = HttpServer;
module.ServerRequest = ServerRequest;
module.ServerResponse = ServerResponse;
module.httpsys_version = version;
};

exports.https.slipstream = function() {
// Make sure original HTTPS module is loaded into native module cache
module = require('https');

module.Server = HttpsServer;
module.createServer = function (options, requestListener) {
// `options` are ignored for API compatibility
// Keys and certificates in HTTP.SYS
// are configured with `netsh http add sslcert`.
var server = new HttpsServer();
if (requestListener) {
server.on('request', requestListener)
}
return server;
};

module.httpsys_version = version;
};

exports.slipstream = function () {
exports.http.slipstream();
exports.https.slipstream();
};
Loading