Skip to content

Browser-sync http2 server returns "Could not proxy request." #4611

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

Closed
hylmar opened this issue May 16, 2022 · 3 comments
Closed

Browser-sync http2 server returns "Could not proxy request." #4611

hylmar opened this issue May 16, 2022 · 3 comments
Labels
type: bug code to address defects in shipped code

Comments

@hylmar
Copy link

hylmar commented May 16, 2022

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

  1. run git clone [email protected]:hylmar/http2-test.git;
  2. run yarn to install;
  3. run yarn dev to start;
  4. browse https://localhost:8000/; this works;
  5. browse https://localhost:9000/; this says Could 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 hylmar added the type: bug code to address defects in shipped code label May 16, 2022
@dsolanorush
Copy link

@hylmar - I'm having this same issue. Did you find a solution?

@tinfoil-knight
Copy link
Contributor

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.

@dsolanorush
Copy link

@tinfoil-knight - the root of the issue for me was two-fold. In nuxt.config.js server config I had:

  1. host set to 0.0.0.0
  2. https cert 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

6 participants