Flexy Proxy Config Specification

Type: object
No Additional Properties

Type: object Default: {}

Defines the default behavior when no specific route matches.

No Additional Properties

Type: string Default: ""

The URL of the proxy to connect to by default.


Example:

"http://default.proxy"

Type: boolean Default: false

Whether to deny access if no routing matches.


Example:

true

Type: enum (of string) Default: "INFO"

The level of logging detail. Possible values are 'DEBUG', 'INFO', 'WARN', or 'ERROR'.

Must be one of:

  • "DEBUG"
  • "INFO"
  • "WARN"
  • "ERROR"

Example:

"DEBUG"

Type: boolean Default: true

If true, eavesdrop all HTTPS access to get the full URL. If false, only eavesdrop HTTP access if the host name matches.


Example:

true

Type: array of object Default: []

Routing settings. Each route defines a URL pattern and the response to return.

No Additional Items

Each item of this array must be:

Type: object

A single route configuration.

No Additional Properties

Type: string

The URL pattern to match. If this URL matches, the specified response will be returned.


Examples:

"https://example.com/api"
"https://example.com/user/[^/]+/post/[^/]"

Type: boolean Default: false

If true, regex can be used for URL matching.


Example:

false

Type: object or null

The response to return. One of 'rewrite', 'content', or 'file' can be specified.

No Additional Properties


Type: object

Rewrite settings. Defines how the URL should be rewritten.

No Additional Properties

Type: string

The pattern to be replaced.


Example:

"^https://example\\\\.com/user/([^/]+)/post/([^/]+)"

Type: string

The replacement string.


Example:

"https://example.com/api?user=$1&post=$2"

Type: boolean Default: false

Whether to use regex for matching the 'from' URL.


Example:

false

Type: string Default: ""

The URL of the proxy to use for this route. If not specified, 'default_route.proxy' will be used. To disable the proxy, specify an empty string.


Example:

"http://proxy.example.com"
Type: string

The destination URL to rewrite.


Example:

"https://example.com/api?user=me"

Type: string

The content to return as the response.


Examples:

"This is the response content"
"not found"

Type: string Default: "text/plain"

The MIME type of the content.


Examples:

"text/plain"
"application/json"

Type: integer Default: 200

The HTTP status code to return.


Examples:

200
404

Type: string Default: ""

The file path to return as the response.


Examples:

"/path/to/file"
"sample.png"

Type: object Default: {}

Additional headers to include in the response.


Example:

{
    "Access-Control-Allow-Origin": "*"
}

Type: string Default: ""

The command to transform the response content.


Examples:

"sed -E 's/foo/bar/g'"
"bash ./script.sh"

Type: string Default: ""

The path to the SSL certificate file.


Example:

"server.crt"

Type: string Default: ""

The path to the private key file corresponding to the SSL certificate.


Example:

"server.key"