vite icon indicating copy to clipboard operation
vite copied to clipboard

Support HTTP2 and Proxy at the same time?

Open williamyorkl opened this issue 3 years ago • 7 comments

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....

https://github.com/http-party/node-http-proxy/issues/1237

Highly appreciated if there is a workaround...

Alternative

No response

Additional context

No response

Validations

williamyorkl avatar Jul 09 '21 06:07 williamyorkl