| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2c056a4 commit 54def06
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,18 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + const common = require('../common'); | ||
| 3 | + const http = require('http'); | ||
| 4 | + | ||
| 5 | + const server = http.Server(function(req, res) { | ||
| 6 | + res.write('Part of my res.'); | ||
| 7 | + res.destroy(); | ||
| 8 | + }); | ||
| 9 | + | ||
| 10 | + server.listen(0, common.mustCall(function() { | ||
| 11 | + http.get({ | ||
| 12 | + port: this.address().port, | ||
| 13 | + headers: { connection: 'keep-alive' } | ||
| 14 | + }, common.mustCall(function(res) { | ||
| 15 | + server.close(); | ||
| 16 | + res.on('aborted', common.mustCall(function() {})); | ||
| 17 | + })); | ||
| 18 | + })); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments