oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.09k stars 2.67k forks source link

call fetch() is error inWindows #9586

Closed Cikaros closed 1 week ago

Cikaros commented 5 months ago

What version of Bun is running?

1.0.35-canary.4+ee5fd51e8

What platform is your computer?

x64

What steps can reproduce the bug?

const response = await fetch("https://bun.sh"); // Happens only at https
const html = await response.text(); // HTML string

What is the expected behavior?

Process finished with exit code 0

What do you see instead?

Syscall: fetch() failed. For more information, pass verbose: true in the second argument to fetch() path: "https://bun.sh"

Process finished with exit code 1

Additional information

No response

paperdave commented 5 months ago

Once the above PR merges, can you try this again and report back what error code is given? Otherwise, there isn't anything I can do about this.

vikas5914 commented 4 months ago

@paperdave Example:

const response = await fetch('https://example.com', {
  proxy: "http://twqhuxwy-rotate:ez1w1miev6ku@p.webshare.io:80/",
  verbose: true
});

console.log(await response.text())

Output:

Request: GET /
        Connection: keep-alive
        User-Agent: Bun/1.1.7
        Accept: */*
        Host: example.com
        Accept-Encoding: gzip, deflate, br

Response: < 200 OK

Syscall: Syscall fetching "https://example.com/". For more information, pass `verbose: true` in the second argument to fetch()
 path: "https://example.com/"

Bun v1.1.7 (Windows x64)
github-actions[bot] commented 1 month ago

This issue is stale and may be closed due to inactivity. If you're still running into this, please leave a comment.

vikas5914 commented 1 month ago

its not

vikas5914 commented 1 month ago

@Jarred-Sumner still having the problem

[fetch] > HTTP/1.1 GET https://example.com/
[fetch] > Connection: keep-alive
[fetch] > User-Agent: Bun/1.1.22
[fetch] > Accept: */*
[fetch] > Host: example.com
[fetch] > Accept-Encoding: gzip, deflate, br

[fetch] < 200 OK

Syscall: Syscall fetching "https://example.com/". For more information, pass `verbose: true` in the second argument to fetch()
 path: "https://example.com/"

Bun v1.1.22-canary.96+df33f2b2a (Windows x64)
Jarred-Sumner commented 1 month ago

Are you using a proxy? A vpn? Is there anything more you can share about your computer?

vikas5914 commented 1 month ago

@Jarred-Sumner I am using proxy with fetch.

const response = await fetch('https://example.com', {
  proxy: "http://twqhuxwy-rotate:ez1w1miev6ku@p.webshare.io:80/",
  verbose: true
});

console.log(await response.text())