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

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

Closed
cYCL157 opened this issue Apr 11, 2018 · 7 comments

Comments

@cYCL157
Copy link

cYCL157 commented 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!

@StefH
Copy link
Collaborator

StefH commented 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.

@SubjectiveReality
Copy link
Contributor

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.

@StefH
Copy link
Collaborator

StefH commented Apr 12, 2018

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

@SubjectiveReality
Copy link
Contributor

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

SubjectiveReality pushed a commit to SubjectiveReality/WireMock.Net that referenced this issue Apr 12, 2018
@StefH StefH changed the title Unable to get host to listen on ips other than 127.0.0.1 using StandAloneApp Issue: Unable to get host to listen on ips other than 127.0.0.1 using StandAloneApp Apr 12, 2018
StefH pushed a commit that referenced this issue Apr 14, 2018
…per issue #124

Change listen from loopback to any ip address for dotnetcore2.0 apps per issue #124 (#125)
@StefH StefH closed this as completed Apr 15, 2018
@SubjectiveReality
Copy link
Contributor

SubjectiveReality commented Apr 16, 2018 via email

@StefH
Copy link
Collaborator

StefH commented Apr 16, 2018

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

@alastairtree
Copy link
Collaborator

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

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

4 participants