Issue: Unable to get host to listen on ips other than 127.0.0.1 using StandAloneApp #92

Closed
opened 2025-12-29 08:22:08 +01:00 by adam · 7 comments
Owner

Originally created by @cYCL157 on GitHub (Apr 11, 2018).

In trying to configure the StandAloneApp to listen on all ips, I keep coming up with the issue that it appears to only listen on 127.0.0.1 (localhost/loopback). I found this line of code that seems like it forces it to loopback:

https://github.com/WireMock-Net/WireMock.Net/blob/master/src/WireMock.Net/Owin/AspNetCoreSelfHost.cs#L79

I am ultimately trying to implement this in a docker container and found this issue in being unable to expose the listening port. Am I missing something?

Thanks for any help! Loving the tool!

Originally created by @cYCL157 on GitHub (Apr 11, 2018). In trying to configure the StandAloneApp to listen on all ips, I keep coming up with the issue that it appears to only listen on 127.0.0.1 (localhost/loopback). I found this line of code that seems like it forces it to loopback: https://github.com/WireMock-Net/WireMock.Net/blob/master/src/WireMock.Net/Owin/AspNetCoreSelfHost.cs#L79 I am ultimately trying to implement this in a docker container and found this issue in being unable to expose the listening port. Am I missing something? Thanks for any help! Loving the tool!
adam closed this issue 2025-12-29 08:22:08 +01:00
Author
Owner

@StefH commented on GitHub (Apr 11, 2018):

I have a project https://github.com/WireMock-Net/WireMock.Net-docker ,did you already see this?

About docker issues : In my case this seemed to be only the case when running a windows container on a windows machine. To fix this I used a docker port proxy tool. Sadly I forgot the real name for that tool, if I remember it, I will copy this here.

@StefH commented on GitHub (Apr 11, 2018): I have a project https://github.com/WireMock-Net/WireMock.Net-docker ,did you already see this? About docker issues : In my case this seemed to be only the case when running a windows container on a windows machine. To fix this I used a docker port proxy tool. Sadly I forgot the real name for that tool, if I remember it, I will copy this here.
Author
Owner

@SubjectiveReality commented on GitHub (Apr 11, 2018):

What do you think about changing System.Net.IPAddress.LoopBack to System.Net.IPAddress.Any? I've cloned and tried this on my windows machine & windows container and it works, but I'm not sure what else this might break. I'm expecting perhaps not much since it is hardcoded currently to listen to LoopBack anyway.

@SubjectiveReality commented on GitHub (Apr 11, 2018): What do you think about changing System.Net.IPAddress.LoopBack to System.Net.IPAddress.Any? I've cloned and tried this on my windows machine & windows container and it works, but I'm not sure what else this might break. I'm expecting perhaps not much since it is hardcoded currently to listen to LoopBack anyway.
Author
Owner

@StefH commented on GitHub (Apr 12, 2018):

Did you also check this on windows in a linux container? If this also works, you can create a PR.

@StefH commented on GitHub (Apr 12, 2018): Did you also check this on windows in a linux container? If this also works, you can create a PR.
Author
Owner

@SubjectiveReality commented on GitHub (Apr 12, 2018):

I have now and it also works. I'll create a PR shortly, thanks!

@SubjectiveReality commented on GitHub (Apr 12, 2018): I have now and it also works. I'll create a PR shortly, thanks!
Author
Owner

@SubjectiveReality commented on GitHub (Apr 16, 2018):

When do you expect to create a new release with the latest merges included?

On Sun, Apr 15, 2018, 4:23 AM Stef Heyenrath notifications@github.com
wrote:

Closed #124 https://github.com/WireMock-Net/WireMock.Net/issues/124.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/WireMock-Net/WireMock.Net/issues/124#event-1574885517,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJ3Z7RWPhnSVChBlmRpPiq3IT3k0cRN2ks5tox-XgaJpZM4TQcUP
.

@SubjectiveReality commented on GitHub (Apr 16, 2018): When do you expect to create a new release with the latest merges included? On Sun, Apr 15, 2018, 4:23 AM Stef Heyenrath <notifications@github.com> wrote: > Closed #124 <https://github.com/WireMock-Net/WireMock.Net/issues/124>. > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > <https://github.com/WireMock-Net/WireMock.Net/issues/124#event-1574885517>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AJ3Z7RWPhnSVChBlmRpPiq3IT3k0cRN2ks5tox-XgaJpZM4TQcUP> > . >
Author
Owner

@StefH commented on GitHub (Apr 16, 2018):

It's merged and a new version is added to NuGet.

@StefH commented on GitHub (Apr 16, 2018): It's merged and a new version is added to NuGet.
Author
Owner

@alastairtree commented on GitHub (Apr 19, 2018):

Thanks, fixed same issue for me when unable to access the standalone mock externally, despite working fine on localhost.

@alastairtree commented on GitHub (Apr 19, 2018): Thanks, fixed same issue for me when unable to access the standalone mock externally, despite working fine on localhost.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net#92