question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm run docker:dev can't request to localhost

See original GitHub issue

I use Laravel as backend, laradock initializes the docker environment. Run npm run docker: dev (use proxy and run start: no-mock) error:

[HPM] Error occurred trying to proxy request / api / auth / login from localhost: 8000 to http: //localhost / (ECONNRESET) (https://nodejs.org/api/errors.html#errors_common_system_errors). note: localhost: server backend using laravel

I don’t know what the error is and how to fix it. If you don’t use docker and run npm run start: no-mock everything back to normal, I’m thinking that there is a problem with the network between containers, I’m not good, please help me

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
chenshuai2144commented, Apr 23, 2019

You can use Docker run --net=host to share the network. The default bridge mode will generate an ip address for each docker

in docker-compose ,you can set network_mode: host

0reactions
tnduccommented, Apr 23, 2019

@bartimaeus list container: Screenshot from 2019-04-23 09-48-50 I tried with external_links but failed, my container list above, I wrote external_links how it works, thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

nodejs app doesn't connect to localhost when running within a ...
Running npm start on command line launches the app successfully on the browser as I'm able to go to localhost:4200 and see the...
Read more >
How to reach localhost on host from docker container?
Situation: I run a NodeJS app with the monero-javascript library to connect to a localhost monero-wallet-rpc running on my host OS. Problem: I ......
Read more >
Previewing running applications in the AWS Cloud9 ...
0.1 , localhost , or 0.0.0.0 . However, if you don't do so, you can't preview your running application from within the IDE....
Read more >
Dockerizing a Node.js Web Application - Semaphore Tutorial
“Docker is an open platform for building, shipping and running distributed applications. It gives programmers, development teams and operations ...
Read more >
Localhost Refused to Connect Error: 5 Confirmed Ways to Fix It
It is a common error that can happens when working on local machines. The localhost simulates a web server running on your computer....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found