Skip to content

Conversation

Corvince
Copy link

@Corvince Corvince commented Oct 1, 2025

Description

Fixes #4184. Previously using https and proxy server options did not work, since http-proxy didn't support https servers. With the recent switch to http-proxy3 this is no longer necessary and vite can support both options simultaneously, allowing to serve with http2.

@Corvince Corvince changed the title Fix #4184 - remove http downgrade when using https and proxy at the same time Fix: #4184 - remove http downgrade when using https and proxy at the same time Oct 1, 2025
@Corvince
Copy link
Author

Corvince commented Oct 1, 2025

Realized this should result in a slight api change - the first argument to resolveHttpServer is of type CommonServerOptions - but only proxy is used here and with this PR no longer. So should the function signature of resolveHttpServer change, to remove the first argument? Not sure how to proceed.

@sapphi-red
Copy link
Member

http-proxy-3 does not support HTTP2 (sagemathinc/http-proxy-3#2), so we cannot do this yet.

@sapphi-red sapphi-red closed this Oct 2, 2025
@sapphi-red sapphi-red reopened this Oct 14, 2025
With the switch to http-proxy3 it should no longer be neccessary to fall back to http when using https and proxy at the same time
Clarified the note regarding TLS downgrade and certificate requirements.
@sapphi-red
Copy link
Member

http-proxy-3 now supports it (sagemathinc/http-proxy-3#33, #20925).

@sapphi-red sapphi-red added the p2-nice-to-have Not breaking anything but nice to have (priority) label Oct 14, 2025
@github-project-automation github-project-automation bot moved this to Discussing in Team Board Oct 14, 2025
@sapphi-red sapphi-red changed the title Fix: #4184 - remove http downgrade when using https and proxy at the same time feat(dev): support HTTP2 even if proxy feature is used Oct 14, 2025
@sapphi-red
Copy link
Member

Realized this should result in a slight api change - the first argument to resolveHttpServer is of type CommonServerOptions - but only proxy is used here and with this PR no longer. So should the function signature of resolveHttpServer change, to remove the first argument? Not sure how to proceed.

@Corvince Would you remove the first parameter from resolveHttpServer?

@Corvince
Copy link
Author

Done. Let me know if there is anything else left to do.

@sapphi-red sapphi-red added this to the 7.2 milestone Oct 14, 2025
Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

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

Thanks, looks good to me

@sapphi-red sapphi-red moved this from Discussing to Approved in Team Board Oct 15, 2025
Copy link

pkg-pr-new bot commented Oct 15, 2025

Open in StackBlitz

npm i https://pkg.pr.new/vite@20869

commit: 48da57b

@sapphi-red
Copy link
Member

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p2-nice-to-have Not breaking anything but nice to have (priority) trigger: preview

Projects

Status: Approved

Development

Successfully merging this pull request may close these issues.

Support HTTP2 and Proxy at the same time?

3 participants