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 recommended protocols for application connections are:

ProtocolDescription

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 Websocket Options for more details.

Element

Description

Name (required)

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

There is no default for this value.

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.

Module (required)

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:

Element

Description

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.

<AMPSConfig>

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

 </AMPSConfig>

Last updated

Copyright 2013-2024 60East Technologies, Inc.