#astro dev server HTTP 2
12 messages · Page 1 of 1 (latest)
This recipe should pretty much cover what you need
https://docs.astro.build/en/recipes/add-yaml-support/
Yep, I though so too but it doesn't work. Here is a minimal reproduction repository https://github.com/alexvuka1/astro-http2. Feel free to pull it and run the commands in the readme. Unfortunately, the curl prints 1.1 and not 2, which is what I need for the file streaming to work
Does setting this option help?
https://vitejs.dev/config/server-options.html#server-https
Shouldn't be needed when using @vitejs/plugin-basic-ssl. I have tried creating a similar repository using vite without astro where this is my vite.config.ts
import viteBasicSslPlugin from '@vitejs/plugin-basic-ssl'
import { defineConfig } from 'vite'
import solid from 'vite-plugin-solid'
export default defineConfig({
plugins: [solid(), viteBasicSslPlugin()],
})
and it works, i.e. the curl command prints 2. Hence I suspect it is something to do with astro dev
Sorry, I stepped away for a bit
I found out that we're setting the vite.server.proxy internally, which causes http/2 to be disabled according to the note on the link.
Setting vite.server.proxy to false in the astro config should fix it I think
Yeah that fixes it. Thank you!
Awesome! Feel free to open an issue so we can track this bug, it should ideally work by default
Ouch. Guess it's time to squash some bugs.
Please open an issue on the withastro/astro repo.
An issue I have since noticed is that setting proxy: false makes it so that Astro.request.url: https://undefined/. @glass rain do you have an idea as to why that might be happening?
Not sure but that looks like a bug, I recommend opening an issue