Skip to content

Bun fetch() throws FailedToOpenSocket when using proxy or unix options #24001

Description

@kevgeoleo

What version of Bun is running?

1.3.1+89fa0f343

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What steps can reproduce the bug?

Hi,

I would like to report a behavior I observed when running the following code snippet:

//snippet1
fetch("https://www.example.com", {
    proxy: "http://something",    
});

//snippet2
fetch("https://www.example.com", {
    unix: "test.sock",    
});

What is the expected behavior?

Run without error as in Node and Deno.

What do you see instead?

Bun gives the following error for snippet 1:

PS D:\HIWI\RESULTS\17_10_2025> bun run .\17203_toreport.ts
error: Unable to connect. Is the computer able to access the url?
  path: "https://www.example.com/",
 errno: 0,
  code: "ConnectionRefused"


Bun v1.3.1 (Windows x64)

Bun gives the following error for snippet 2:

PS D:\HIWI\RESULTS\17_10_2025> bun run .\17203_toreport.ts
error: Was there a typo in the url or port?
  path: "https://www.example.com/",
 errno: 0,
  code: "FailedToOpenSocket"


Bun v1.3.1 (Windows x64)

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions