Skip to content
Myr

Default Server#host to null (INADDR_ANY)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

use run(3000, localhost) etc as needed

authored by visionmedia · committed by visionmedia · parent 93239ae · Browse files · 1 file+5 added−15 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−15 removed

  • other:+5 added−15 removed

1 file+5 added−15 removed

modified:lib/express/core.js+5 added-15 removed
187 unmodified lines
188 * Default host ip, when null node will accept requests on 189 * all network addresses.190 */191 192 host: 'localhost',192 host: null,193 194 /**195 * Maximum number of queued connections.196 */197 198 backlog: 128,199 200 /**201 * Run Express.195 * Run Express with optional _port_ defaulting to 3000,196 * and host defaulting to null (INADDR_ANY).197 *203 * - Buffers request bodies204 * - Calls #route() once the request is complete205 *198 * @param {int} port199 * @param {string} host208 * @param {int} backlog200 * @see run()201 * @api private202 */203 213 run: function(port, host, backlog){204 run: function(port, host){205 var self = this206 if (host !== undefined) this.host = host207 if (port !== undefined) this.port = port217 if (backlog !== undefined) this.backlog = backlog208 http209 .createServer(function(req, response){210 var request, pendingFiles = 0211 req.setBodyEncoding('binary')
48 unmodified lines
260 .addListener('data', function(chunk){ request.body += chunk })261 .addListener('end', callback)262 })263 .listen(this.port, this.host, this.backlog)274 sys.puts('Express started at http://' + this.host + ':' + this.port + '/ in ' + Express.environment + ' mode')264 sys.puts('Express started at http://' + (this.host || '*') + ':' + this.port + '/ in ' + Express.environment + ' mode')265 },266 267 /**268 * Route the given _request_.
57 unmodified lines