cloudflare / cloudflare/workers-sdk

🐛 BUG: Support `HTTP_PROXY` in `wrangler dev --remote`

Open
#5,162 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.5k
Forks
1.5k
Avg merge
3d 8h
Merged PRs (30d)
186

Description

### Which Cloudflare product(s) does this pertain to?

R2, Workers Runtime

### What version(s) of the tool(s) are you using?

3.30.1[wrangler]

### What version of Node are you using?

v20.10.0

### What operating system and version are you using?

macOS Ventura 13.4.1

### Describe the Bug

### Observed behavior
I start with an 'hello worker' initialization project. When I run npx wrangler dev and visit http://localhost:8787/, I get 'Hello world', which is expected. However, the terminal shows the error 'Failed to register worker in local service registry TypeError: fetch failed'. It might be a normal error since I'm in Mainland China and cannot access websites like YouTube and Google without a VPN.

When I execute npx wrangler dev --remote and navigate to http://localhost:8787/, the browser consistently remains in a pending state. Additionally, I encounter the error '✘ [ERROR] Error while creating remote dev session: TypeError: fetch failed' in the terminal.

When I activate ClashX VPN and execute `HTTP_PROXY=http://localhost:7890 npx wrangler dev --remote`, accessing http://localhost:8787/ still results in a perpetual pending state. After some time, an error message appears in the terminal: '✘ [ERROR] Error in ProxyController: Error inside ProxyWorker { name: 'Error', message: 'internal error', stack: 'Error: internal error' }'. Despite this, I am confident that my VPN allows me to normally access websites like YouTube and Google.

### Expected behavior
When I run `HTTP_PROXY=http://localhost:7890 npx wrangler dev --remote`, works api can work normally.

### Steps to reproduce
A 'hello worker' initialization project.

image
image
image

### Please provide a link to a minimal reproduction

_No response_

### Please provide any relevant error logs

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.