限制与NodeJS服务器的最大连接数

时间:2015-09-23 16:54:07

标签: node.js

var http = require('http');
var express = require("express");
var BinaryServer = require('binaryjs').BinaryServer;
var fs = require('fs');

var addon = require('./build/Release/addon.node');
console.log(addon);

var bodyParser = require("body-parser");
var app = express();
var exec = require('child_process').execFile;
var WebSocket = require('faye-websocket');
var server = http.createServer(app);

server.maxConnections = 2;//<-----

我正在尝试限制与我的http服务器的连接。为此,我使用maxConnections。不幸的是,这似乎无效。是因为我在localhost模式下测试它吗?

0 个答案:

没有答案