mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-26 10:18:26 +02:00
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:
@@ -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; }
|
||||
}
|
||||
}
|
||||
}
|
||||
20
src/WireMock.Net/Settings/IWebProxySettings.cs
Normal file
20
src/WireMock.Net/Settings/IWebProxySettings.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
19
src/WireMock.Net/Settings/WebProxySettings.cs
Normal file
19
src/WireMock.Net/Settings/WebProxySettings.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user