By default, if backend server returns 4xx error in response to /connect or /publish (or another direct invoke method), the reason phrase to send to a client is taken from response header. For example, if response to /connect is
then the following Websocket message will be sent to the client
Since build 5.2.968 it is possible to send a custom reason phrase to the client in this case. To do this, the backend should return the following JSON object
The following message will be sent to the client
The JSON object should contain
reason fields only. If one of the fields is absent, or some other fields are added to the response object, the reason phrase to send to the client will be taken from backend server response header, as done by default.