Add WebProxySettings (use when proxying requests) (#370)

* webproxy part 1

* fixed

* Push to MyGet

* WebProxy standalone

* -n true

* nuget --- "-n true"

* AllowAutoRedirect

* .
This commit is contained in:
Stef Heyenrath
2019-12-07 08:52:04 +01:00
committed by GitHub
parent 8bafd6a1ba
commit 1b326a54d6
16 changed files with 266 additions and 51 deletions

View File

@@ -44,5 +44,15 @@ namespace WireMock.Settings
/// Defines a list of cookies which will excluded from the saved mappings.
/// </summary>
string[] BlackListedCookies { get; set; }
/// <summary>
/// Defines the WebProxySettings.
/// </summary>
IWebProxySettings WebProxySettings { get; set; }
/// <summary>
/// Proxy requests should follow redirection (30x).
/// </summary>
bool? AllowAutoRedirect { get; set; }
}
}
}

View File

@@ -0,0 +1,20 @@
namespace WireMock.Settings
{
public interface IWebProxySettings
{
/// <summary>
/// A string instance that contains the address of the proxy server.
/// </summary>
string Address { get; set; }
/// <summary>
/// The user name associated with the credentials.
/// </summary>
string UserName { get; set; }
/// <summary>
/// The password for the user name associated with the credentials.
/// </summary>
string Password { get; set; }
}
}

View File

@@ -34,5 +34,13 @@ namespace WireMock.Settings
/// <inheritdoc cref="IProxyAndRecordSettings.BlackListedCookies"/>
[PublicAPI]
public string[] BlackListedCookies { get; set; }
/// <inheritdoc cref="IProxyAndRecordSettings.WebProxySettings"/>
[PublicAPI]
public IWebProxySettings WebProxySettings { get; set; }
/// <inheritdoc cref="IProxyAndRecordSettings.AllowAutoRedirect"/>
[PublicAPI]
public bool? AllowAutoRedirect { get; set; }
}
}

View File

@@ -0,0 +1,19 @@
using JetBrains.Annotations;
namespace WireMock.Settings
{
public class WebProxySettings : IWebProxySettings
{
/// <inheritdoc cref="IWebProxySettings.Address"/>
[PublicAPI]
public string Address { get; set; }
/// <inheritdoc cref="IWebProxySettings.UserName"/>
[PublicAPI]
public string UserName { get; set; }
/// <inheritdoc cref="IWebProxySettings.Password"/>
[PublicAPI]
public string Password { get; set; }
}
}