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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Test configuration file
#
# This is more in depth than the example.
#
# NOTE: Until we have made a release, configuration format should
# be considered entirely unstable, and likely to make breaking changes
# commit-to-commit!
[]
# Threads per service
= 8
# Specify a Basic Proxy service, which features minimal configuration.
#
# Note that indentation isn't significant in TOML, it is only done
# here to note the structure of the data.
#
# TODO: This data is very structured, and TOML might not be a good fit.
[[]]
= "Example1"
# Each `basic-proxy` can have one or more Listeners, or downstream
# connections. If you provide zero, the basic proxy will terminate
# immediately.
[[]]
# TODO: "listeners" only has one field, we might want to use
# serde flatten
[]
# Listeners can have kind of "Tcp" (w/ or w/o TLS) or "Uds"
# for "Unix Domain Sockets", which cannot have TLS.
= "Tcp"
[]
# TCP must specify the address, which includes the port to bind to
= "0.0.0.0:8080"
# `basic-proxy`s can have multiple listeners
[[]]
[]
= "Tcp"
[]
= "0.0.0.0:4443"
# To enable TLS, specify the path to the certificate and key
[]
= "./assets/test.crt"
= "./assets/test.key"
# Each `basic proxy` must have exactly one "connector", or the upstream
# server they will proxy to.
#
# To use TLS for upstream connections, specify the SNI of the connection
[]
= "91.107.223.4:443"
= "onevariable.com"
# "Path Control" affects requests and responses as they are proxied
[]
# upstream request filters specifically allow for the cancellation or modification
# of requests, as they are being made.
#
# Filters are applied in the order they are specified. Multiple instances of
# each filter may be provided.
= [
# Remove any headers with keys matching `pattern`
{ = "remove-header-key-regex", = ".*(secret|SECRET).*" },
# Add or replace (e.g. "Upsert") a fixed header with the given key and value
{ = "upsert-header", = "x-proxy-friend", = "river" },
]
= [
# Remove any headers with keys matching `pattern`
{ = "remove-header-key-regex", = ".*ETag.*" },
# Add or replace (e.g. "Upsert") a fixed header with the given key and value
{ = "upsert-header", = "x-with-love-from", = "river" },
]
# We specify a second basic proxy as well. Here we use the other table syntax
[[]]
= "Example2"
= [
{ = { = "Tcp", = { = "0.0.0.0:8000" } } }
]
= { = "91.107.223.4:80" }