mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
1 parent
9e6498d5fa
commit
c9b40da368
6 files changed
+324
-4
No files matched your search
@@ -23,9 +23,15 @@ var tls = require('tls');
|
||||
var http = require('http');
|
||||
var inherits = require('util').inherits;
|
||||
|
||||
var NPN_ENABLED = process.binding('constants').NPN_ENABLED;
|
||||
|
||||
function Server(opts, requestListener) {
|
||||
if (!(this instanceof Server)) return new Server(opts, requestListener);
|
||||
|
||||
if (NPN_ENABLED && !opts.NPNProtocols) {
|
||||
opts.NPNProtocols = ['http/1.1', 'http/1.0'];
|
||||
}
|
||||
|
||||
tls.Server.call(this, opts, http._connectionListener);
|
||||
|
||||
this.httpAllowHalfOpen = false;
|
||||
@@ -58,6 +64,10 @@ Agent.prototype.defaultPort = 443;
|
||||
|
||||
|
||||
Agent.prototype._getConnection = function(host, port, cb) {
|
||||
if (NPN_ENABLED && !this.options.NPNProtocols) {
|
||||
this.options.NPNProtocols = ['http/1.1', 'http/1.0'];
|
||||
}
|
||||
|
||||
var s = tls.connect(port, host, this.options, function() {
|
||||
// do other checks here?
|
||||
if (cb) cb();
|
||||
|
||||
Reference in new issue
Block a user