Is it possible to start a WireMockServer with http and https without specifying a port? #449

Closed
opened 2025-12-29 08:28:20 +01:00 by adam · 8 comments
Owner

Originally created by @zidad on GitHub (Sep 19, 2022).

Originally assigned to: @StefH on GitHub.

This only starts 1 the HTTPS url:
var server1 = WireMockServer.Start(port: null, ssl: true);
And this requires me to specify ports:

var server2 = WireMockServer.Start(new WireMockServerSettings
{
    Urls = new[] { "http://localhost:9091", "https://localhost:9443" }
});

so something like this?

var server2 = WireMockServer.Start(new WireMockServerSettings
{
    Urls = new[] { "http://localhost:null", "https://localhost:null" }
});
Originally created by @zidad on GitHub (Sep 19, 2022). Originally assigned to: @StefH on GitHub. This only starts 1 the HTTPS url: `var server1 = WireMockServer.Start(port: null, ssl: true); ` And this requires me to specify ports: ``` var server2 = WireMockServer.Start(new WireMockServerSettings { Urls = new[] { "http://localhost:9091", "https://localhost:9443" } }); ``` so something like this? ``` var server2 = WireMockServer.Start(new WireMockServerSettings { Urls = new[] { "http://localhost:null", "https://localhost:null" } }); ```
adam added the question label 2025-12-29 08:28:20 +01:00
adam closed this issue 2025-12-29 08:28:21 +01:00
Author
Owner

@StefH commented on GitHub (Sep 21, 2022):

@zidad
This is not yet possible, I'll look into this.

@StefH commented on GitHub (Sep 21, 2022): @zidad This is not yet possible, I'll look into this.
Author
Owner

@zidad commented on GitHub (Sep 21, 2022):

Much appreciated!

@zidad commented on GitHub (Sep 21, 2022): Much appreciated!
Author
Owner

@StefH commented on GitHub (Sep 21, 2022):

@zidad
You can try preview version 1.5.6-ci-16455 (https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions)

And use it like:

var httpAndHttpsFree = WireMockServer.Start(new WireMockServerSettings
{
  HostingProtocol = HostingProtocol.HttpAndHttps,
});
@StefH commented on GitHub (Sep 21, 2022): @zidad You can try preview version `1.5.6-ci-16455` (https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions) And use it like: ``` c# var httpAndHttpsFree = WireMockServer.Start(new WireMockServerSettings { HostingProtocol = HostingProtocol.HttpAndHttps, }); ```
Author
Owner

@StefH commented on GitHub (Sep 26, 2022):

@zidad, did you have time to test this?

@StefH commented on GitHub (Sep 26, 2022): @zidad, did you have time to test this?
Author
Owner

@zidad commented on GitHub (Sep 26, 2022):

Hi @StefH, testing it as you typed this comment :)... just a sec

@zidad commented on GitHub (Sep 26, 2022): Hi @StefH, testing it as you typed this comment :)... just a sec
Author
Owner

@zidad commented on GitHub (Sep 26, 2022):

@StefH it works for me, many thanks!

@zidad commented on GitHub (Sep 26, 2022): @StefH it works for me, many thanks!
Author
Owner

@StefH commented on GitHub (Sep 26, 2022):

Thanks for testing.

I'll merge this PR.

Note that in the final version, the enum will be named HostingScheme/

@StefH commented on GitHub (Sep 26, 2022): Thanks for testing. I'll merge this PR. Note that in the final version, the enum will be named `HostingScheme`/
Author
Owner

@StefH commented on GitHub (Sep 26, 2022):

https://github.com/WireMock-Net/WireMock.Net/pull/818

@StefH commented on GitHub (Sep 26, 2022): https://github.com/WireMock-Net/WireMock.Net/pull/818
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net#449