|
|
@ -26,9 +26,11 @@ var srv = net.createServer(function(c) { |
|
|
|
c.end(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
srv.listen(common.PORT, '127.0.0.1'); |
|
|
|
|
|
|
|
var gotUpgrade = false; |
|
|
|
|
|
|
|
srv.listen(common.PORT, '127.0.0.1', function () { |
|
|
|
|
|
|
|
var hc = http.createClient(common.PORT, '127.0.0.1'); |
|
|
|
hc.addListener('upgrade', function(res, socket, upgradeHead) { |
|
|
|
// XXX: This test isn't fantastic, as it assumes that the entire response
|
|
|
@ -48,6 +50,7 @@ hc.addListener('upgrade', function(res, socket, upgradeHead) { |
|
|
|
gotUpgrade = true; |
|
|
|
}); |
|
|
|
hc.request('GET', '/').end(); |
|
|
|
}); |
|
|
|
|
|
|
|
process.addListener('exit', function() { |
|
|
|
assert.ok(gotUpgrade); |
|
|
|