[PR #1165] [MERGED] Fix listen on AnyIP for url 0.0.0.0 #1262

Closed
opened 2025-12-29 09:19:05 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/wiremock/WireMock.Net/pull/1165
Author: @cocoon
Created: 9/4/2024
Status: Merged
Merged: 9/7/2024
Merged by: @StefH

Base: masterHead: fix/ListenAnyIp0000


📝 Commits (10+)

  • ae82432 fix listen to AnyIP if url is 0.0.0.0
  • e4f587d Add Test for listenin on AnyIP for url 0.0.0.0
  • 3ce97e0 add missing using, use var, indent, remove empty line
  • 38ac9bf remove assert for ipv4/v6 address list
  • 4a8430f test only if NET6_0_OR_GREATER
  • b27f0a5 use same code style
  • 3a2d68a add missing +
  • 97a3d9d Asser. to Assert
  • 6ccc15b split single test into one for IPv4 and one for IPv6
  • 46aca87 Create IgnoreOnContinuousIntegrationFact.cs

📊 Changes

3 files changed (+102 additions, -6 deletions)

View changed files

📝 src/WireMock.Net/Owin/AspNetCoreSelfHost.NETStandard.cs (+9 -2)
test/WireMock.Net.Tests/Facts/IgnoreOnContinuousIntegrationFact.cs (+22 -0)
📝 test/WireMock.Net.Tests/WireMockServerTests.cs (+71 -4)

📄 Description

To listen on all available IPs this fix allows to use the following URL:

var settings = new WireMockServerSettings
{
    Urls = new string[] { "http://0.0.0.0:80" },
};
var server = WireMockServer.Start(settings);

I tried to add a test, but I think the test can be improved.
Could be split in a test for IPv4 and IPv6 and maybe the naming is not perfect.
Getting all IPs could be moved into a utility method ...
Feel free to improve afterwards.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/wiremock/WireMock.Net/pull/1165 **Author:** [@cocoon](https://github.com/cocoon) **Created:** 9/4/2024 **Status:** ✅ Merged **Merged:** 9/7/2024 **Merged by:** [@StefH](https://github.com/StefH) **Base:** `master` ← **Head:** `fix/ListenAnyIp0000` --- ### 📝 Commits (10+) - [`ae82432`](https://github.com/wiremock/WireMock.Net/commit/ae82432be11b09ba3dcf7097b9eb26ed999c34fc) fix listen to AnyIP if url is 0.0.0.0 - [`e4f587d`](https://github.com/wiremock/WireMock.Net/commit/e4f587db9dd81562a754b4e6759d6b6d12761c7a) Add Test for listenin on AnyIP for url 0.0.0.0 - [`3ce97e0`](https://github.com/wiremock/WireMock.Net/commit/3ce97e06e0e1a5faa71964e6814c2f8fba6e507a) add missing using, use var, indent, remove empty line - [`38ac9bf`](https://github.com/wiremock/WireMock.Net/commit/38ac9bfd1ca63eeacef282b5dd1e47e3ae06b85f) remove assert for ipv4/v6 address list - [`4a8430f`](https://github.com/wiremock/WireMock.Net/commit/4a8430f0e2afb3abc2034b12d6c50a1fc77a2ec4) test only if NET6_0_OR_GREATER - [`b27f0a5`](https://github.com/wiremock/WireMock.Net/commit/b27f0a5720c280206b084c93f73214f58ea549ad) use same code style - [`3a2d68a`](https://github.com/wiremock/WireMock.Net/commit/3a2d68a2878c0f9cb909c487b0d6196c2180f537) add missing + - [`97a3d9d`](https://github.com/wiremock/WireMock.Net/commit/97a3d9d44b23643a4063f679ea48a0815e51bf52) Asser. to Assert - [`6ccc15b`](https://github.com/wiremock/WireMock.Net/commit/6ccc15b5df7b83289178c681845fd1b5e9c0165d) split single test into one for IPv4 and one for IPv6 - [`46aca87`](https://github.com/wiremock/WireMock.Net/commit/46aca87477885ec2194ebce201d8a00143871d74) Create IgnoreOnContinuousIntegrationFact.cs ### 📊 Changes **3 files changed** (+102 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/WireMock.Net/Owin/AspNetCoreSelfHost.NETStandard.cs` (+9 -2) ➕ `test/WireMock.Net.Tests/Facts/IgnoreOnContinuousIntegrationFact.cs` (+22 -0) 📝 `test/WireMock.Net.Tests/WireMockServerTests.cs` (+71 -4) </details> ### 📄 Description To listen on all available IPs this fix allows to use the following URL: ``` var settings = new WireMockServerSettings { Urls = new string[] { "http://0.0.0.0:80" }, }; var server = WireMockServer.Start(settings); ``` I tried to add a test, but I think the test can be improved. Could be split in a test for IPv4 and IPv6 and maybe the naming is not perfect. Getting all IPs could be moved into a utility method ... Feel free to improve afterwards. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 09:19:05 +01:00
adam closed this issue 2025-12-29 09:19:05 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net#1262