Nyzo techRelease notesNyzo 626: relay virtual hosting

Nyzo 626: relay virtual hosting

Nyzo version 626 (commit on GitHub) adds virtual hosting capability to the relay server.

This version affects the relay server.

In RelayController, the host parameter is now read from the relay endpoints file if provided. An endpoint with an empty host parameter serves as a fallback for all requests, while an endpoint with a specified host parameter takes precedence for the specified host only.

RN_626 image 0

The host field was added to the Endpoint class.

RN_626 image 1

In the Endpoint.getParentEndpoint() method, the host field is now passed to the constructor for the parent.

The new Endpoint.getEmptyHost() method produces a copy of an Endpoint with the host field erased to the empty string.

RN_626 image 2

The host is now considered in Endpoint.hashCode() and Endpoint.equals().

RN_626 image 3

In WebListener.readMessageAndRespond(), the headers from the web request are now read into a Map.

RN_626 image 4

For POST requests, the content-length header is now read from the headers map.

RN_626 image 5

The host header is now used in building the Endpoint for requests.

RN_626 image 6

In the WebListener.getResponse() method, the host of the Endpoint is now considered. Matching is performed according to the following priority:

RN_626 image 7