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

Extension for Docker gives "connection refused" error for localhost connections, v.0.1.3 #89

Closed
yilmazdurmaz opened this issue Oct 29, 2022 · 6 comments

Comments

@yilmazdurmaz
Copy link

  • In Docker Desktop, Windows 10 21H2, install Ddosify extension and try to connect to a server on localhost. The following result comes out with "connection refused" at the bottom for all requests.

⚙️ Initializing...
🔥 Engine fired.

✅ Successful Run: 0 0% ❌ Failed Run: 14 100% ⏱️ Avg. Duration: 0.00000s
✅ Successful Run: 0 0% ❌ Failed Run: 29 100% ⏱️ Avg. Duration: 0.00000s
✅ Successful Run: 0 0% ❌ Failed Run: 44 100% ⏱️ Avg. Duration: 0.00000s
✅ Successful Run: 0 0% ❌ Failed Run: 59 100% ⏱️ Avg. Duration: 0.00000s
✅ Successful Run: 0 0% ❌ Failed Run: 74 100% ⏱️ Avg. Duration: 0.00000s
✅ Successful Run: 0 0% ❌ Failed Run: 89 100% ⏱️ Avg. Duration: 0.00000s
✅ Successful Run: 0 0% ❌ Failed Run: 100 100% ⏱️ Avg. Duration: 0.00000s

RESULT

Success Count: 0 (0%)
Failed Count: 100 (100%)

Durations (Avg):

Error Distribution (Count:Reason):
100 :connection refused

  • I can connect to the "address:port" from browser without a problem.
  • I tried different ports; no chance there neither.
@yilmazdurmaz
Copy link
Author

I see the problem:

  • Extension (or at least ddosify) are also containerized applications, so they need to be treated just like any other container when the network connections are needed.

So, to connect to my host, I had to use host.docker.internal instead of localhost.

Although the problem is solved, it would be best to have this as a warning on the app's main screen.

PS: if someone comes here with the same problem, the following page has more solutions for the same issue if this does not solve their issue:
https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach

@fatihbaltaci
Copy link
Member

Hi @yilmazdurmaz, thanks for letting us know about this issue. There was another issue with a localhost connection, but it was resolved.

Which version of Ddosify Docker Extension do you use?

@yilmazdurmaz
Copy link
Author

I guess I used different keywords so I missed that one. The problem is the same, and it is alive despite the resolution mentioned in that one.

Which version of Ddosify Docker Extension do you use?

0.1.3

@fatihbaltaci
Copy link
Member

I will check the problem on a Windows Docker Desktop, then let you know

@yilmazdurmaz
Copy link
Author

There is another detail I did not think if it related to the problem:

  • the server I try to connect to is running in a minikube k8s environment (uses docker/wsl2), and the pod's port is forwarded to the host.

this is how I started my test server:

  • start k8s cluster. I use minikube: minikube start
  • start a basic nginx app and forward its port.
kubectl run webapp --image=nginx:alpine
kubectl port-forward webapp 8000:80
  • now try connection localhost:8000 (change port if 8000 is in use)

@fatihbaltaci
Copy link
Member

Hi @yilmazdurmaz,

We added a tip for host.docker.internal in Ddosify Docker Extension 0.2.1 version.

image

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants