Add support to bind to ip-address instead of only localhost (#1100)

* Add support to bind to ip-address instead of only localhost

* .

* .
This commit is contained in:
Stef Heyenrath
2024-05-17 21:46:07 +02:00
committed by GitHub
parent 0b278dbbbb
commit 2c001f661d
3 changed files with 68 additions and 11 deletions

View File

@@ -94,8 +94,42 @@ message HelloReply {
fullName:String
}";
private static void RunOnLocal()
{
try
{
var serverOnPrivateIPAddress192_168_1 = WireMockServer.Start(new WireMockServerSettings
{
Urls = new[] { "http://192.168.1.166:8102" }
});
System.Console.WriteLine($"{string.Join(", ", serverOnPrivateIPAddress192_168_1.Urls)}");
serverOnPrivateIPAddress192_168_1.Stop();
}
catch (Exception e)
{
System.Console.WriteLine("serverOnPrivateIPAddress192: " + e);
}
try
{
var serverOnPrivateIPAddress172_19 = WireMockServer.Start(new WireMockServerSettings
{
Urls = new[] { "https://172.19.80.1:8103" }
});
System.Console.WriteLine($"{string.Join(", ", serverOnPrivateIPAddress172_19.Urls)}");
serverOnPrivateIPAddress172_19.Stop();
}
catch (Exception e)
{
System.Console.WriteLine("serverOnPrivateIPAddress172_19: " + e);
}
}
public static void Run()
{
RunOnLocal();
return;
var mappingBuilder = new MappingBuilder();
mappingBuilder
.Given(Request