rancher-sandbox / rancher-desktop

Container Management and Kubernetes on the Desktop
https://rancherdesktop.io
Apache License 2.0
5.92k stars 281 forks source link

Browsersync proxy endlessly waits when pointed to a Rancher container #6358

Open hdodov opened 8 months ago

hdodov commented 8 months ago

Actual Behavior

When Browsersync proxies a Rancher container on the host machine, a response is never returned and you're just stuck there, waiting. This doesn't happen with Docker Desktop and OrbStack

Steps to Reproduce

  1. Clone the reproduction repo: https://github.com/hdodov/mcve-rancher-proxying
  2. Run npm run dev, which starts Rancher and Webpack
  3. You should have Rancher running on http://localhost:8000 and Browsersync on http://localhost:9000
  4. You'd be able to open http://localhost:8000 and see the regular NGINX page, but http://localhost:9000 (which proxies the former URL) will never open

Result

Endless waiting in the browser and in cURL.

Expected Behavior

Both URLs (on 8000 and on 9000) should open, like they do with Docker Desktop and OrbStack.

Additional Information

No response

Rancher Desktop Version

1.12.1

Rancher Desktop K8s Version

deactivated

Which container engine are you using?

moby (docker cli)

What operating system are you using?

macOS

Operating System / Build Version

macOS Sonoma 14.2.1

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

None

Windows User Only

No response

jandubois commented 8 months ago

I cannot reproduce the issue on my Sonoma machine.

In addition to your repro instructions I also ran brew install webpack and npm i before npm run dev. Afterwards I could connect to both port 8000 and 9000.

  npm: '10.2.4',
  node: '21.6.1',
hdodov commented 8 months ago

@jandubois it appears that the Node versions plays a role, actually. My colleague @todor0v pointed out that you're using Node 21.6.1. And if I do, in fact, try with 21.6.1 — it works on my machine too.

I narrowed the versions down to the following:

Could you reproduce the same behavior on your side as well? By the way, I use Volta to easily switch between Node versions, if that'll help.