Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support http proxy #24

Merged
merged 3 commits into from
Nov 15, 2022
Merged

feat: support http proxy #24

merged 3 commits into from
Nov 15, 2022

Conversation

ikexing-cn
Copy link
Contributor

@ikexing-cn ikexing-cn commented Nov 4, 2022

it's works fine in my environment. #23

src/_utils.ts Outdated
@@ -46,6 +47,13 @@ export function debug (...args) {
}
}

export async function sendFetch (url: string, options?: RequestInit) {
const proxy = process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy
const agent = createHttpsProxyAgent(proxy)
Copy link

@xehpuk xehpuk Nov 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this throw when proxy is falsy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@pi0 pi0 merged commit e579a2f into unjs:main Nov 15, 2022
@ikexing-cn ikexing-cn deleted the feature/support-proxy branch November 15, 2022 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants