# DSL: Wayfarer.Dsl
The Wayfarer DSL for defining static proxy configurations.
## DSL options
## wayfarer
* [config](#module-config)
* health_checks
* check
* host_patterns
* pattern
* listeners
* http
* https
* targets
* http
* health_checks
* check
* https
* health_checks
* check
* plug
---
### config
* health_checks
* check
* host_patterns
* pattern
* listeners
* http
* https
* targets
* http
* health_checks
* check
* https
* health_checks
* check
* plug
* `:name` (`t:String.t/0`) -
##### health_checks
* check
###### check
* `:name` - A unique name for the health check.
* `:method` - The HTTP method to use for the request. Valid values are :get, :head, :post, :put, :delete, :connect, :options, :trace, :patch The default value is `:get`.
* `:connect_timeout` (`t:pos_integer/0`) - Connection timeout in milliseconds The default value is `5000`.
* `:response_timeout` (`t:pos_integer/0`) - Response timeout in milliseconds The default value is `500`.
* `:hostname` - The HTTP hostname to use when sending the request. Defaults to the IP address.
* `:interval` (`t:pos_integer/0`) - Interval in milliseconds The default value is `30000`.
* `:threshold` (`t:pos_integer/0`) - Success threshold The default value is `3`.
* `:path` (`t:String.t/0`) - Path The default value is `"/"`.
* `:success_codes` - HTTP status codes which are considered successful. The default value is `[200..299]`.
##### host_patterns
* pattern
###### pattern
* `:pattern` (`t:String.t/0`) - Required. A hostname matching pattern.
##### listeners
* http
* https
###### http
* `:scheme` - Required. The listening protocol. Valid values are :http, :https
* `:address` - Required. The address of the interface to listen on.
* `:name` - A unique name for the listener (defaults to the URI).
* `:port` (`t:pos_integer/0`) - Required. The TCP port on which to listen for incoming connections.
* `:http_1_options` (`t:keyword/0`) - Options to configure the HTTP/1 stack in Bandit. The default value is `[]`.
* `:http_2_options` (`t:keyword/0`) - Options to configure the HTTP/2 stack in Bandit. The default value is `[]`.
* `:thousand_island_options` (`t:keyword/0`) - Possible options to configure a ThousandIsland server. The default value is `[]`.
* `:websocket_options` (`t:keyword/0`) - Options to configure the WebSocket stack in Bandit. The default value is `[]`.
###### https
* `:scheme` - Required. The listening protocol. Valid values are :http, :https
* `:address` - Required. The address of the interface to listen on.
* `:name` - A unique name for the listener (defaults to the URI).
* `:port` (`t:pos_integer/0`) - Required. The TCP port on which to listen for incoming connections.
* `:http_1_options` (`t:keyword/0`) - Options to configure the HTTP/1 stack in Bandit. The default value is `[]`.
* `:http_2_options` (`t:keyword/0`) - Options to configure the HTTP/2 stack in Bandit. The default value is `[]`.
* `:thousand_island_options` (`t:keyword/0`) - Possible options to configure a ThousandIsland server. The default value is `[]`.
* `:websocket_options` (`t:keyword/0`) - Options to configure the WebSocket stack in Bandit. The default value is `[]`.
* `:certfile` (`t:String.t/0`) - The path to a file containing the SSL certificate to use for this listener.
* `:keyfile` (`t:String.t/0`) - The path to a file containing the SSL key to use for this listener.
* `:cipher_suite` - Used to define a pre-selected set of ciphers, as described by `Plug.SSL.configure/1`. Valid values are nil, :strong, :compatible
##### targets
* http
* health_checks
* check
* https
* health_checks
* check
* plug
* `:algorithm` - The target selection algorithm. Valid values are :round_robin, :sticky The default value is `:round_robin`.
###### http
* health_checks
* check
* `:address` - Required. The address of the interface to listen on.
* `:name` - A unique name for the target (defaults to the URI).
* `:port` (`t:pos_integer/0`) - Required. The TCP port on which to listen for incoming connections.
####### health_checks
* check
######## check
* `:name` - A unique name for the health check.
* `:method` - The HTTP method to use for the request. Valid values are :get, :head, :post, :put, :delete, :connect, :options, :trace, :patch The default value is `:get`.
* `:connect_timeout` (`t:pos_integer/0`) - Connection timeout in milliseconds The default value is `5000`.
* `:response_timeout` (`t:pos_integer/0`) - Response timeout in milliseconds The default value is `500`.
* `:hostname` - The HTTP hostname to use when sending the request. Defaults to the IP address.
* `:interval` (`t:pos_integer/0`) - Interval in milliseconds The default value is `30000`.
* `:threshold` (`t:pos_integer/0`) - Success threshold The default value is `3`.
* `:path` (`t:String.t/0`) - Path The default value is `"/"`.
* `:success_codes` - HTTP status codes which are considered successful. The default value is `[200..299]`.
###### https
* health_checks
* check
* `:address` - Required. The address of the interface to listen on.
* `:name` - A unique name for the target (defaults to the URI).
* `:port` (`t:pos_integer/0`) - Required. The TCP port on which to listen for incoming connections.
####### health_checks
* check
######## check
* `:name` - A unique name for the health check.
* `:method` - The HTTP method to use for the request. Valid values are :get, :head, :post, :put, :delete, :connect, :options, :trace, :patch The default value is `:get`.
* `:connect_timeout` (`t:pos_integer/0`) - Connection timeout in milliseconds The default value is `5000`.
* `:response_timeout` (`t:pos_integer/0`) - Response timeout in milliseconds The default value is `500`.
* `:hostname` - The HTTP hostname to use when sending the request. Defaults to the IP address.
* `:interval` (`t:pos_integer/0`) - Interval in milliseconds The default value is `30000`.
* `:threshold` (`t:pos_integer/0`) - Success threshold The default value is `3`.
* `:path` (`t:String.t/0`) - Path The default value is `"/"`.
* `:success_codes` - HTTP status codes which are considered successful. The default value is `[200..299]`.
###### plug
* `:module` - Required. A plug which can handle requests.
## wayfarer
### Nested DSLs
* [config](#wayfarer-config)
* health_checks
* check
* host_patterns
* pattern
* listeners
* http
* https
* targets
* http
* health_checks
* check
* https
* health_checks
* check
* plug
## wayfarer.config
```elixir
config name \ nil
```
### Nested DSLs
* [health_checks](#wayfarer-config-health_checks)
* check
* [host_patterns](#wayfarer-config-host_patterns)
* pattern
* [listeners](#wayfarer-config-listeners)
* http
* https
* [targets](#wayfarer-config-targets)
* http
* health_checks
* check
* https
* health_checks
* check
* plug
### Arguments
Name |
Type |
Default |
Docs |
name
|
String.t
|
|
|
## wayfarer.config.health_checks
### Nested DSLs
* [check](#wayfarer-config-health_checks-check)
## wayfarer.config.health_checks.check
```elixir
check name \ nil
```
### Arguments
Name |
Type |
Default |
Docs |
name
|
String.t | nil
|
|
A unique name for the health check.
|
### Options
Name |
Type |
Default |
Docs |
method
|
:get | :head | :post | :put | :delete | :connect | :options | :trace | :patch
|
:get
|
The HTTP method to use for the request.
|
connect_timeout
|
pos_integer
|
5000
|
Connection timeout in milliseconds
|
response_timeout
|
pos_integer
|
500
|
Response timeout in milliseconds
|
hostname
|
nil | String.t
|
|
The HTTP hostname to use when sending the request. Defaults to the IP address.
|
interval
|
pos_integer
|
30000
|
Interval in milliseconds
|
threshold
|
pos_integer
|
3
|
Success threshold
|
path
|
String.t
|
"/"
|
Path
|
success_codes
|
list(Range) | Range
|
[200..299]
|
HTTP status codes which are considered successful.
|
### Introspection
Target: `Wayfarer.Dsl.HealthCheck`
### Introspection
Target: `Wayfarer.Dsl.HealthChecks`
## wayfarer.config.host_patterns
### Nested DSLs
* [pattern](#wayfarer-config-host_patterns-pattern)
## wayfarer.config.host_patterns.pattern
```elixir
pattern pattern
```
### Arguments
Name |
Type |
Default |
Docs |
pattern
*
|
String.t
|
|
A hostname matching pattern.
|
### Introspection
Target: `Wayfarer.Dsl.HostPattern`
### Introspection
Target: `Wayfarer.Dsl.HostPatterns`
## wayfarer.config.listeners
### Nested DSLs
* [http](#wayfarer-config-listeners-http)
* [https](#wayfarer-config-listeners-https)
## wayfarer.config.listeners.http
```elixir
http address, port
```
### Arguments
Name |
Type |
Default |
Docs |
address
*
|
IP.Address | String.t
|
|
The address of the interface to listen on.
|
port
*
|
pos_integer
|
|
The TCP port on which to listen for incoming connections.
|
### Options
Name |
Type |
Default |
Docs |
scheme
*
|
:http | :https
|
|
The listening protocol.
|
name
|
nil | String.t
|
|
A unique name for the listener (defaults to the URI).
|
http_1_options
|
Keyword.t
|
[]
|
Options to configure the HTTP/1 stack in Bandit.
|
http_2_options
|
Keyword.t
|
[]
|
Options to configure the HTTP/2 stack in Bandit.
|
thousand_island_options
|
Keyword.t
|
[]
|
Possible options to configure a ThousandIsland server.
|
websocket_options
|
Keyword.t
|
[]
|
Options to configure the WebSocket stack in Bandit.
|
### Introspection
Target: `Wayfarer.Dsl.Listener`
## wayfarer.config.listeners.https
```elixir
https address, port
```
### Arguments
Name |
Type |
Default |
Docs |
address
*
|
IP.Address | String.t
|
|
The address of the interface to listen on.
|
port
*
|
pos_integer
|
|
The TCP port on which to listen for incoming connections.
|
### Options
Name |
Type |
Default |
Docs |
scheme
*
|
:http | :https
|
|
The listening protocol.
|
name
|
nil | String.t
|
|
A unique name for the listener (defaults to the URI).
|
http_1_options
|
Keyword.t
|
[]
|
Options to configure the HTTP/1 stack in Bandit.
|
http_2_options
|
Keyword.t
|
[]
|
Options to configure the HTTP/2 stack in Bandit.
|
thousand_island_options
|
Keyword.t
|
[]
|
Possible options to configure a ThousandIsland server.
|
websocket_options
|
Keyword.t
|
[]
|
Options to configure the WebSocket stack in Bandit.
|
certfile
|
String.t
|
|
The path to a file containing the SSL certificate to use for this listener.
|
keyfile
|
String.t
|
|
The path to a file containing the SSL key to use for this listener.
|
cipher_suite
|
nil | :strong | :compatible
|
|
Used to define a pre-selected set of ciphers, as described by `Plug.SSL.configure/1`.
|
### Introspection
Target: `Wayfarer.Dsl.Listener`
### Introspection
Target: `Wayfarer.Dsl.Listeners`
## wayfarer.config.targets
### Nested DSLs
* [http](#wayfarer-config-targets-http)
* health_checks
* check
* [https](#wayfarer-config-targets-https)
* health_checks
* check
* [plug](#wayfarer-config-targets-plug)
### Options
Name |
Type |
Default |
Docs |
algorithm
|
:round_robin | :sticky
|
:round_robin
|
The target selection algorithm.
|
## wayfarer.config.targets.http
```elixir
http address, port
```
### Nested DSLs
* [health_checks](#wayfarer-config-targets-http-health_checks)
* check
### Arguments
Name |
Type |
Default |
Docs |
address
*
|
IP.Address | String.t
|
|
The address of the interface to listen on.
|
port
*
|
pos_integer
|
|
The TCP port on which to listen for incoming connections.
|
### Options
Name |
Type |
Default |
Docs |
name
|
nil | String.t
|
|
A unique name for the target (defaults to the URI).
|
## wayfarer.config.targets.http.health_checks
### Nested DSLs
* [check](#wayfarer-config-targets-http-health_checks-check)
## wayfarer.config.targets.http.health_checks.check
```elixir
check name \ nil
```
### Arguments
Name |
Type |
Default |
Docs |
name
|
String.t | nil
|
|
A unique name for the health check.
|
### Options
Name |
Type |
Default |
Docs |
method
|
:get | :head | :post | :put | :delete | :connect | :options | :trace | :patch
|
:get
|
The HTTP method to use for the request.
|
connect_timeout
|
pos_integer
|
5000
|
Connection timeout in milliseconds
|
response_timeout
|
pos_integer
|
500
|
Response timeout in milliseconds
|
hostname
|
nil | String.t
|
|
The HTTP hostname to use when sending the request. Defaults to the IP address.
|
interval
|
pos_integer
|
30000
|
Interval in milliseconds
|
threshold
|
pos_integer
|
3
|
Success threshold
|
path
|
String.t
|
"/"
|
Path
|
success_codes
|
list(Range) | Range
|
[200..299]
|
HTTP status codes which are considered successful.
|
### Introspection
Target: `Wayfarer.Dsl.HealthCheck`
### Introspection
Target: `Wayfarer.Dsl.HealthChecks`
### Introspection
Target: `Wayfarer.Dsl.Target`
## wayfarer.config.targets.https
```elixir
https address, port
```
### Nested DSLs
* [health_checks](#wayfarer-config-targets-https-health_checks)
* check
### Arguments
Name |
Type |
Default |
Docs |
address
*
|
IP.Address | String.t
|
|
The address of the interface to listen on.
|
port
*
|
pos_integer
|
|
The TCP port on which to listen for incoming connections.
|
### Options
Name |
Type |
Default |
Docs |
name
|
nil | String.t
|
|
A unique name for the target (defaults to the URI).
|
## wayfarer.config.targets.https.health_checks
### Nested DSLs
* [check](#wayfarer-config-targets-https-health_checks-check)
## wayfarer.config.targets.https.health_checks.check
```elixir
check name \ nil
```
### Arguments
Name |
Type |
Default |
Docs |
name
|
String.t | nil
|
|
A unique name for the health check.
|
### Options
Name |
Type |
Default |
Docs |
method
|
:get | :head | :post | :put | :delete | :connect | :options | :trace | :patch
|
:get
|
The HTTP method to use for the request.
|
connect_timeout
|
pos_integer
|
5000
|
Connection timeout in milliseconds
|
response_timeout
|
pos_integer
|
500
|
Response timeout in milliseconds
|
hostname
|
nil | String.t
|
|
The HTTP hostname to use when sending the request. Defaults to the IP address.
|
interval
|
pos_integer
|
30000
|
Interval in milliseconds
|
threshold
|
pos_integer
|
3
|
Success threshold
|
path
|
String.t
|
"/"
|
Path
|
success_codes
|
list(Range) | Range
|
[200..299]
|
HTTP status codes which are considered successful.
|
### Introspection
Target: `Wayfarer.Dsl.HealthCheck`
### Introspection
Target: `Wayfarer.Dsl.HealthChecks`
### Introspection
Target: `Wayfarer.Dsl.Target`
## wayfarer.config.targets.plug
```elixir
plug module
```
### Arguments
Name |
Type |
Default |
Docs |
module
*
|
module
|
|
A plug which can handle requests.
|
### Introspection
Target: `Wayfarer.Dsl.Target`
### Introspection
Target: `Wayfarer.Dsl.Targets`
### Introspection
Target: `Wayfarer.Dsl.Config`