Skip to main content

2. Client Configuration

  1. Client Configuration

HTTP clients are configured to use a UDP proxy with a URI Template [TEMPLATE] that has the variables "target_host" and "target_port". Examples are shown below:

https://example.org/.well-known/masque/udp/\{target_host\}/\{target_port\}/ https://proxy.example.org:4443/masque?h=\{target_host\}&p=\{target_port\} https://proxy.example.org:4443/masque{?target_host,target_port}

                Figure 1: URI Template Examples

The following requirements apply to the URI Template:

  • The URI Template MUST be a level 3 template or lower.

  • The URI Template MUST be in absolute form and MUST include non- empty scheme, authority, and path components.

  • The path component of the URI Template MUST start with a slash ("/").

  • All template variables MUST be within the path or query components of the URI.

  • The URI Template MUST contain the two variables "target_host" and "target_port" and MAY contain other variables.

  • The URI Template MUST NOT contain any non-ASCII Unicode characters and MUST only contain ASCII characters in the range 0x21-0x7E inclusive (note that percent-encoding is allowed; see Section 2.1 of [URI]).

  • The URI Template MUST NOT use Reserved Expansion ("+" operator), Fragment Expansion ("#" operator), Label Expansion with Dot- Prefix, Path Segment Expansion with Slash-Prefix, nor Path-Style Parameter Expansion with Semicolon-Prefix.

Clients SHOULD validate the requirements above; however, clients MAY use a general-purpose URI Template implementation that lacks this specific validation. If a client detects that any of the requirements above are not met by a URI Template, the client MUST reject its configuration and abort the request without sending it to the UDP proxy.

The original HTTP CONNECT method allowed for the conveyance of the target host and port, but not the scheme, proxy authority, path, or query. Thus, clients with proxy configuration interfaces that only allow the user to configure the proxy host and the proxy port exist. Client implementations of this specification that are constrained by such limitations MAY attempt to access UDP proxying capabilities using the default template, which is defined as "https://$PROXY_HOST:$PROXY_PORT/.well-known/masque/ udp/{target_host}/{target_port}/", where $PROXY_HOST and $PROXY_PORT are the configured host and port of the UDP proxy, respectively. UDP proxy deployments SHOULD offer service at this location if they need to interoperate with such clients.