-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathProgram.cs
More file actions
38 lines (31 loc) · 1.34 KB
/
Program.cs
File metadata and controls
38 lines (31 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using Fluxzy;
using Fluxzy.Rules.Actions;
namespace Samples.No013.ModifyHeaders
{
internal class Program
{
/// <summary>
/// Manipulating request and response headers
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
static async Task Main(string[] args)
{
var fluxzySetting = FluxzySetting.CreateDefault();
fluxzySetting.ConfigureRule()
// Add response cookie on any ongoing response
.WhenAny()
.Do(
new AddRequestHeaderAction("new-header", "value"),
new DeleteRequestHeaderAction("Date"), // Delete request header
new UpdateRequestHeaderAction("User-Agent", "{{previous}} - add suffix to user-agent"),
new AddResponseHeaderAction("new-response-header", "value"),
new DeleteResponseHeaderAction("Date"), // Delete response header
new UpdateResponseHeaderAction("Server", "{{previous}} - add suffix to server"));
await using var proxy = new Proxy(fluxzySetting);
proxy.Run();
Console.WriteLine("Press any key to exit");
Console.ReadKey();
}
}
}