Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions test/js/bun/http/proxy-stress-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,11 @@ export async function createAdversarialProxy(opts: AdversarialProxyOptions = {})
// and getaddrinfo want the bare literal.
if (host.startsWith("[") && host.endsWith("]")) host = host.slice(1, -1);

// Origins bind 127.0.0.1 but advertise `localhost`; on darwin that
// resolves `::1` first, and v4/v6 ephemeral-port spaces are independent,
// so dial the bound address. IPv6-literal tests pass `[::1]` explicitly.
if (host === "localhost") host = "127.0.0.1";

upstream = net.connect(port, host);
let clientEnded = false;
const endClient = () => {
Expand Down
Loading