| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ | |||
| 20 | 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. | |
| 21 | 21 | ||
| 22 | 22 | 'use strict'; | |
| 23 | - const common = require('../common'); | ||
| 23 | + require('../common'); | ||
| 24 | 24 | ||
| 25 | 25 | // Make sure http server doesn't wait for socket pool to establish connections | |
| 26 | 26 | // https://github.com/nodejs/node-v0.x-archive/issues/877 | |
@@ -40,13 +40,14 @@ const server = http.createServer(function(req, res) { | |||
| 40 | 40 | res.end('Hello World\n'); | |
| 41 | 41 | }); | |
| 42 | 42 | ||
| 43 | - const addrString = agent.getName({ host: '127.0.0.1', port: common.PORT }); | ||
| 43 | + server.listen(0, '127.0.0.1', function() { | ||
| 44 | + const { port } = server.address(); | ||
| 45 | + const addrString = agent.getName({ host: '127.0.0.1', port }); | ||
| 44 | 46 | ||
| 45 | - server.listen(common.PORT, '127.0.0.1', function() { | ||
| 46 | 47 | for (let i = 0; i < N; i++) { | |
| 47 | 48 | const options = { | |
| 48 | 49 | host: '127.0.0.1', | |
| 49 | - port: common.PORT | ||
| 50 | + port | ||
| 50 | 51 | }; | |
| 51 | 52 | ||
| 52 | 53 | const req = http.get(options, function(res) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments