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

Support HTTP2 and Proxy at the same time? #4184

Open
4 tasks done
williamyorkl opened this issue Jul 9, 2021 · 8 comments
Open
4 tasks done

Support HTTP2 and Proxy at the same time? #4184

williamyorkl opened this issue Jul 9, 2021 · 8 comments
Labels
enhancement New feature or request performance Performance related enhancement

Comments

@williamyorkl
Copy link

Clear and concise description of the problem

Hi there, is there any way that I can turn on the https and proxy options on vite.config.js at the same time ? Because I want to use http2 and proxy...

Because as what vite officially in the document states that if the proxy option is on, then it will downgrade and TSL only, which mean it will lose http2 function..

image

Suggested solution

as I have tried some ways, but it all seem fails....
use http-proxy-middleware and create a middleware proxy,using the configreServer API that vite provide, then I could turn on https option in vite.config.js, but it seems that it wouldn't work, because I am facing this error....

http-party/node-http-proxy#1237

Highly appreciated if there is a workaround...

Alternative

No response

Additional context

No response

Validations

@benatshippabo
Copy link
Contributor

benatshippabo commented Oct 5, 2021

Yeah this would be really nice to have 👍 . It does feel like the http-proxy dependency is unmaintained though since there are so many PRs that have not been reviewed yet and the last commit was over a year ago.

@williamyorkl
Copy link
Author

Problem solved!my plugin would work ~
https://github.com/williamyorkl/vite-plugin-proxy-middleware

@mitar
Copy link

mitar commented Mar 13, 2022

@williamyorkl Does it also proxy HTTP2 push?

@patak-dev patak-dev added enhancement New feature or request performance Performance related enhancement and removed enhancement: pending triage labels Mar 10, 2023
@sapphi-red
Copy link
Member

Linking some related disucssions: #7611 (comment)

@xfournet
Copy link

For simple proxy case https://gist.github.com/xfournet/068592b3d1ddd488427b874b23f707bf

@mitar
Copy link

mitar commented Nov 23, 2023

For Go backend development I made https://gitlab.com/tozd/waf which allows proxying Vite requests to Vite while the rest (API calls) is handled by Go during development.

@zhe-he
Copy link

zhe-he commented Dec 18, 2023

Hmm, I want it to support HTTP/3.0, is there a way?

@muuvmuuv
Copy link

Wait, no... I have waited so long to use Vite/esbuild in Angular with the new dev-server builder, and now you tell me I am back in 2013 with http/1.1. 🥲

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance Performance related enhancement
Projects
None yet
Development

No branches or pull requests

8 participants