Skip to content
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

🐛 BUG: Support HTTP_PROXY in wrangler dev --remote #5162

Open
chengfengfengwang opened this issue Mar 5, 2024 · 2 comments
Open

🐛 BUG: Support HTTP_PROXY in wrangler dev --remote #5162

chengfengfengwang opened this issue Mar 5, 2024 · 2 comments
Labels
bug Something that isn't working

Comments

@chengfengfengwang
Copy link

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

@chengfengfengwang chengfengfengwang added the bug Something that isn't working label Mar 5, 2024
@y-hikaru-walabo
Copy link

Perhaps the VPN has no impact.
I'm in Japan and don't use VPN, but I get the same error if I have the --remote option.
I'm specifying the remote option because I want to use a non-local R2.
Hopefully this will be resolved soon.

Mac 13.3.1
wrangler 3.31.0
hono 4.0.10

@penalosa
Copy link
Contributor

I think we've run into problems with this before, and unfortunately if you're unable to access the Cloudflare API Wrangler won't be able to work. Can you access https://api.cloudflare.com? If not, you'll have to use wrangler dev (without the --remote flag).

wrangler dev --remote doesn't currently support the HTTP_PROXY environment, and so that won't have any effect. I'll leave this issue open to track investigating support for HTTP_PROXY in wrangler dev --remote.

@y-hikaru-walabo it sounds like you're running into a different problem—could you open a new issue with details for us to investigate?

@penalosa penalosa changed the title 🐛 BUG: After npx wrangler dev --remote, the workers do not work properly 🐛 BUG: Support HTTP_PROXY in wrangler dev --remote Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
Status: Backlog
Development

No branches or pull requests

3 participants