15. ProtocolsΒΆ
In AMPS, Protocols
define the format of the commands that clients use to
communicate with the server.
AMPS offers a range of preconfigured protocols. The most commonly-used protocols are:
Protocol | Description |
---|---|
amps |
Standard protocol for AMPS clients |
websocket |
Standard protocol for websocket connections using the AMPS Javascript library |
The Protocols
element configures options for a given protocol. The element
is a container for one or more Protocol
elements. Each Protocol
is a
combination of a Module
, that defines the basic protocol, and a set of
options to configure the behavior of that basic protocol.
Many installations of AMPS have no need to configure a Protocols
block.
Element | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Name
|
The name to use for the customized Protocol. This name is used in the There is no default for this value. 60East recommends that the |
||||||||||||||||||
Module
|
This element defines the protocol module to customize. The By default, AMPS loads the following protocols:
|
Table 15.1: Protocol Parameters
The websocket
protocol accepts the following additional configuration options:
Element | Description | ||||||
---|---|---|---|---|---|---|---|
WWWAuthenticate |
The type of authentication used for this protocol. This specifies how the connection will receive credentials from the connection. The
For example, to use basic authentication and set the realm to a value of
|
||||||
TrustedAdmin |
Specify whether connections that use this protocol should accept connections from clients that have successfully authenticated to the administrative interface. Default: |
||||||
HttpHeader |
Specify that the server will return the custom header specified in response
to a websocket request. A protocol of There is no default for this element. |
Table 15.2: Websocket Transport Parameters
<AMPSConfig>
...
<Protocols>
<Protocol>
<Name>websocket-portal</Name>
<Module>websocket</Module>
<WWWAuthenticate>Basic realm="AMPS Admin"</WWWAuthenticate>
<TrustedAdmin>enabled</TrustedAdmin>
</Protocol>
</Protocols>
</AMPSConfig>
Example 15.1: Websockets Protocol Configuration Example