This commit is contained in:
Stef Heyenrath
2020-03-25 16:00:15 +00:00
committed by GitHub
parent 8a295e806c
commit 5809fae602
4 changed files with 186 additions and 183 deletions

View File

@@ -2,7 +2,7 @@
"profiles": { "profiles": {
"WireMock.Net.StandAlone.NETCoreApp": { "WireMock.Net.StandAlone.NETCoreApp": {
"commandName": "Project", "commandName": "Project",
"commandLineArgs": "--Urls http://*:9091 --WireMockLogger WireMockConsoleLogger" "commandLineArgs": "--Port 9091 --WireMockLogger WireMockConsoleLogger"
} }
} }
} }

View File

@@ -7,6 +7,8 @@ namespace WireMock.Owin
{ {
public ICollection<string> Urls { get; set; } public ICollection<string> Urls { get; set; }
public int? Port { get; set; }
public bool UseSSL { get; set; } public bool UseSSL { get; set; }
public ICollection<(string Url, int Port)> GetDetails() public ICollection<(string Url, int Port)> GetDetails()
@@ -14,7 +16,7 @@ namespace WireMock.Owin
var list = new List<(string Url, int Port)>(); var list = new List<(string Url, int Port)>();
if (Urls == null) if (Urls == null)
{ {
int port = FindFreeTcpPort(); int port = Port ?? FindFreeTcpPort();
list.Add(($"{(UseSSL ? "https" : "http")}://localhost:{port}", port)); list.Add(($"{(UseSSL ? "https" : "http")}://localhost:{port}", port));
} }
else else

View File

@@ -214,7 +214,8 @@ namespace WireMock.Server
{ {
urlOptions = new HostUrlOptions urlOptions = new HostUrlOptions
{ {
UseSSL = settings.UseSSL == true UseSSL = settings.UseSSL == true,
Port = settings.Port
}; };
} }