Listen on more ip-address/ports (#18)

This commit is contained in:
Stef Heyenrath
2017-01-30 22:12:58 +01:00
parent 517304b999
commit de914ef24d
3 changed files with 51 additions and 21 deletions

View File

@@ -27,19 +27,18 @@ namespace WireMock.Http
/// <summary>
/// Initializes a new instance of the <see cref="TinyHttpServer"/> class.
/// </summary>
/// <param name="urlPrefix">
/// The url prefix.
/// </param>
/// <param name="httpHandler">
/// The http handler.
/// </param>
public TinyHttpServer(string urlPrefix, Action<HttpListenerContext> httpHandler)
/// <param name="urls">The urls.</param>
/// <param name="httpHandler">The http handler.</param>
public TinyHttpServer(string[] urls, Action<HttpListenerContext> httpHandler)
{
_httpHandler = httpHandler;
// Create a listener.
_listener = new HttpListener();
_listener.Prefixes.Add(urlPrefix);
foreach (string urlPrefix in urls)
{
_listener.Prefixes.Add(urlPrefix);
}
}
/// <summary>