mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 22:01:47 +00:00
back
This commit is contained in:
@@ -11,7 +11,7 @@ const h2 = require('http2');
|
||||
let serverResponse;
|
||||
|
||||
const server = h2.createServer();
|
||||
server.listen(0, "127.0.0.1", common.mustCall(function() {
|
||||
server.listen(0, common.mustCall(function() {
|
||||
const port = server.address().port;
|
||||
server.once('request', common.mustCall(function(request, response) {
|
||||
serverResponse = response;
|
||||
@@ -34,9 +34,10 @@ server.listen(0, "127.0.0.1", common.mustCall(function() {
|
||||
response.flushHeaders(); // Idempotent
|
||||
});
|
||||
}));
|
||||
|
||||
}));
|
||||
|
||||
const url = `http://127.0.0.1:${port}`;
|
||||
const url = `http://localhost:${port}`;
|
||||
const client = h2.connect(url, common.mustCall(function() {
|
||||
const headers = {
|
||||
':path': '/',
|
||||
@@ -56,4 +57,4 @@ server.listen(0, "127.0.0.1", common.mustCall(function() {
|
||||
request.end();
|
||||
request.resume();
|
||||
}));
|
||||
}));
|
||||
}));
|
||||
Reference in New Issue
Block a user