Configuring 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.

Described below are the recommended protocols for application connections. Expand each item for more details.

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. When this is required, it is most common to need to specify the options used by the websocket protocol to match the needs of the operating environment. See the Websocket Options section below for more details.

Described below are the configuration items for defining a Protocol. Expand each item for more details.

Name

The name to use for the customized Protocol. This name is used in the Transport element to refer to the customized Protocol.

60East recommends that the Name of the customized Protocol contain the Name of the Module.

For example, a customized protocol that adjusts the behavior of the websocket protocol might be named websocket-custom.

There is no default for this value.

Module

This element defines the protocol module to customize. The Module must be the name of a protocol module loaded into AMPS.

By default, AMPS loads the following protocols:

  • amps - Standard AMPS messaging, using compact headers in JSON-based format. AMPS accepts json as a synonym for amps in a protocol declaration.

  • fix-session - FIX session protocol, for use with systems that publish FIX messages using this format.

  • websocket - Websocket protocol, using JSON format headers.

AMPS provides the following protocols for backward compatibility. These protocols are supported for existing usage, but will not be enhanced with future protocol changes and do not support all features of the above protocols.

  • fix - Standard AMPS messaging, using headers in FIX format.

  • nvfix - Standard AMPS messaging, using headers in NVFIX format.

  • soap - Standard AMPS messaging, using headers in SOAP format.

  • xml - Standard AMPS messaging, using headers in XML format.

Websocket Options

The websocket protocol accepts the following additional configuration options. Expand each item for more details.

WWWAuthenticate

The type of authentication used for this protocol. This specifies how the connection will receive credentials from the connection.

The websocket protocol accepts two options for this element:

  • Negotiate - Use the "negotiate" scheme for HTTP authentication.

  • Basic - Use basic authentication. When basic authentication is specified, the realm must also be set. The syntax for setting the realm value is realm=<name of realm>.

For example, to use basic authentication and set the realm to a value of HTTP Special, you would use the following WWWAuthenticate element:

<WWWAuthenticate>Basic realm="HTTP Special"</WWWAuthenticate>
TrustedAdmin

Specify whether connections that use this protocol should accept connections from clients that have successfully authenticated to the administrative interface.

Default: false

HTTPHeader

Specify that the server will return the custom header specified in response to a websocket request.

A protocol of websocket type can have any number of these elements configured, and AMPS will return all of the headers defined.

There is no default for this element.

The following configuration snippet shows one way to define a customized websocket protocol:

<AMPSConfig>

   ...
   <Protocols>
     <Protocol>
       <Name>websocket-portal</Name>
       <Module>websocket</Module>
       <WWWAuthenticate>Basic realm="AMPS Admin"</WWWAuthenticate>
       <TrustedAdmin>enabled</TrustedAdmin>
     </Protocol>
   </Protocols>
   ...

 </AMPSConfig>

Last updated