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

Can't proxy from localhost:3000 to localhost:7000 without internet connection #1116

Closed
rksh1997 opened this issue Nov 29, 2016 · 9 comments
Closed

Comments

@rksh1997
Copy link

rksh1997 commented Nov 29, 2016

In my client's package.json.
"proxy": "http://localhost:7000"
with internet connection everything is fine and the api works awesome.
without internet connection it shows me this error:
Could not proxy request /api/users/signup from localhost:3000 to http://localhost:7000 (ENOENT).
the problem is that mot of my time I am offline.

@chimurai
Copy link

Try using 127.0.0.1 instead of localhost.

http-party/node-http-proxy#835 (comment)

@gaearon
Copy link
Contributor

gaearon commented Nov 30, 2016

Can we fix this in https://github.com/nodejitsu/node-http-proxy?

@gaearon
Copy link
Contributor

gaearon commented Dec 5, 2016

Apparently it's "by design" in Node?
vladimir-shcherbakov/node@8e0f244#comments

I don't really understand this. Should we just hardcode it to use 127.0.0.1 instead of localhost on Windows, like https://github.com/seanpoulter/growly/commit/9fc8a610032ca705162a70647e6a52c9a302c6cb?

@rksh1997
Copy link
Author

rksh1997 commented Dec 7, 2016

@gaearon I did that, and it worked, I didn't find any other solution

@gaearon
Copy link
Contributor

gaearon commented Dec 7, 2016

I'll take a PR that does it on Windows (the problem is specific to Windows right?). Would you like to submit one?

@bunshar
Copy link
Contributor

bunshar commented Jan 12, 2017

I am working on this now.

@gaearon
Copy link
Contributor

gaearon commented Mar 7, 2017

@bunshar Any updates?

@vikasaditya
Copy link

@gaearon the change was very small but lost my access to windows machine for testing. Will install on virtualbox and send PR with a day or two.

@Timer
Copy link
Contributor

Timer commented Aug 2, 2017

I believe this has been fixed. Please open if this still reproduces on the newest react-scripts.

@Timer Timer closed this as completed Aug 2, 2017
@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants