UNPKG

490 BJavaScriptView Raw
1var Agent = require('http').Agent;
2var util = require('util');
3
4var SpdyAgent = module.exports = function(options) {
5 this.socket = options.socket;
6 this.host = options.host;
7 this.port = options.port;
8 Agent.call(this, options);
9};
10util.inherits(SpdyAgent, Agent);
11
12SpdyAgent.prototype.createConnection = function(options) {
13 // Needs to emit connect in the next pass of the event loop
14 setImmediate(function() {
15 options.socket.emit('connect');
16 });
17 return options.socket;
18};