mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-01 23:23:29 +02:00
fix port (#446)
This commit is contained in:
@@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -214,7 +214,8 @@ namespace WireMock.Server
|
|||||||
{
|
{
|
||||||
urlOptions = new HostUrlOptions
|
urlOptions = new HostUrlOptions
|
||||||
{
|
{
|
||||||
UseSSL = settings.UseSSL == true
|
UseSSL = settings.UseSSL == true,
|
||||||
|
Port = settings.Port
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user