oven-sh / bun

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

proxy does not work with axios #13245

Open kelvinwop opened 3 months ago

kelvinwop commented 3 months ago

What version of Bun is running?

1.1.20+ae1948925

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What steps can reproduce the bug?

const PROXY_CONFIG = {
    protocol: 'http',
    host: host,
    port: Number(port).valueOf(),
    auth: {
      username: username,
      password: password
    }
  }

let odds_config = {
    method: 'get',
    maxBodyLength: Infinity,
    url: `http://xxx.xxx/xxx`,
    headers: {
      'Authorization': 'Basic xxx'
    },
    proxy: PROXY_CONFIG
  };

What is the expected behavior?

works on node js

What do you see instead?

fails on bun with error code 407 Proxy Authentication Required

Additional information

No response

Hamza12700 commented 3 months ago

I'm on BUN v1.1.22 and it works just fine.

kelvinwop commented 3 months ago

Very weird, I migrated my code to ts-node and it works again

kelvinwop commented 2 months ago

UPgraded to bun version 1.1.25, still error 407 proxy authentication required