Browser-sync http2 server returns "Could not proxy request."
Describe the bug
My local environment was running smoothly with netlify dev booting my custom framework, which simply started an http server using browser-sync. However, I wanted my local dev environment to use http2, so I updated my setup accordingly. Now when I start my server through netlify dev, my custom framework is serving everything well with http2 at port 8000, but the netlify layer at port 9000 returns "Could not proxy request."
I've tried debugging netlify-cli, but no luck so far. Does anyone have a clue what could be the issue?
Steps to reproduce
- run
git clone [email protected]:hylmar/http2-test.git; - run
yarnto install; - run
yarn devto start; - browse
https://localhost:8000/; this works; - browse
https://localhost:9000/; this saysCould not proxy request..
Configuration
[build]
functions = "build/functions"
base = ""
publish = "build"
command = "npm run deploy"
[dev]
framework = "#custom"
command = "koios dev"
targetPort = 8000
port = 9000
publish = "build"
autoLaunch = false
[dev.https]
certFile = "cert/localhost-cert.pem"
keyFile = "cert/localhost-privkey.pem"
Environment
System:
OS: macOS 11.6
CPU: (8) x64 Apple M1
Memory: 172.72 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
Yarn: 1.22.17 - ~/.nvm/versions/node/v16.14.0/bin/yarn
npm: 8.3.1 - ~/.nvm/versions/node/v16.14.0/bin/npm
npmGlobalPackages:
netlify-cli: 10.3.1
@hylmar - I'm having this same issue. Did you find a solution?
Hey @dsolanorush, I tried to debug this issue with the given repo but wasn't able to due to unrelated errors in the repository. If you've a public repo where I could reproduce this issue, I can try again.
@tinfoil-knight - the root of the issue for me was two-fold. In nuxt.config.js server config I had:
hostset to0.0.0.0httpscert applied
I completely removed the custom server config and let Nuxt use defaults, then applied my existing cert to the Netlify dev server TOML config. This allowed proxying to work as expected.