Module: Stomp

Defined in:
lib/stomp.rb,
lib/stomp/codec.rb,
lib/client/utils.rb,
lib/stomp/client.rb,
lib/stomp/errors.rb,
lib/stomp/message.rb,
lib/stomp/version.rb,
lib/connection/utf8.rb,
lib/stomp/constants.rb,
lib/stomp/sslparams.rb,
lib/connection/netio.rb,
lib/connection/utils.rb,
lib/stomp/connection.rb,
lib/stomp/null_logger.rb,
lib/connection/heartbeats.rb

Defined Under Namespace

Modules: Error, Version Classes: Client, Connection, HeaderCodec, Message, NullLogger, SSLParams

Constant Summary collapse

CMD_CONNECT =

Client generated frames

"CONNECT"
CMD_STOMP =
"STOMP"
CMD_DISCONNECT =
"DISCONNECT"
CMD_SEND =
"SEND"
CMD_SUBSCRIBE =
"SUBSCRIBE"
CMD_UNSUBSCRIBE =
"UNSUBSCRIBE"
CMD_ACK =
"ACK"
CMD_NACK =
"NACK"
CMD_BEGIN =
"BEGIN"
CMD_COMMIT =
"COMMIT"
CMD_ABORT =
"ABORT"
CMD_CONNECTED =

Server generated names

"CONNECTED"
CMD_MESSAGE =
"MESSAGE"
CMD_RECEIPT =
"RECEIPT"
CMD_ERROR =
"ERROR"
SERVER_FRAMES =

Server Frames

{CMD_CONNECTED => true, CMD_MESSAGE => true,
CMD_RECEIPT => true, CMD_ERROR => true}
SPL_10 =

Protocols

"1.0"
SPL_11 =
"1.1"
SPL_12 =
"1.2"
SUPPORTED =

Stomp 1.0 and 1.1 and 1.2

[SPL_10, SPL_11, SPL_12]
UTF8 =

UTF-8 Encoding Name

"UTF-8"
NULL =

Octet 0

"\0"
NL =

New line

"\n"
NL_ASCII =
0x0a
LF =

Line Feed (New Line)

"\n"
LF_ASCII =
0x0a
CR =

New line

"\r"
CR_ASCII =
0x0d
BACK_SLASH =

Back Slash

"\\"
BACK_SLASH_ASCII =
0x5c
LITERAL_COLON =

Literal colon

":"
COLON_ASCII =
0x3a
LITERAL_C =

Literal letter c

"c"
C_ASCII =
0x63
LITERAL_N =

Literal letter n

"n"
N_ASCII =
0x6e
ENCODE_VALUES =

Codec from/to values.

[
  "\\\\\\\\", "\\", # encoded, decoded
  "\\" + "n", "\n",
  "\\" + "r", "\r",
  "\\c", ":",
]
DECODE_VALUES =
[
  "\\\\", "\\", # encoded, decoded
  "\\" + "n", "\n",
  "\\" + "r", "\r",
  "\\c", ":",
]
DEFAULT_CIPHERS =

A fairly safe and generally supported ciphers list.

[
  ["AES128-GCM-SHA256","TLSv1/SSLv3",128,128],
  ["AES128-SHA256","TLSv1/SSLv3",128,128],
  ["AES128-SHA","TLSv1/SSLv3",128,128],
  ["AES256-GCM-SHA384","TLSv1/SSLv3",256,256],
  ["AES256-SHA256","TLSv1/SSLv3",256,256],
  ["AES256-SHA","TLSv1/SSLv3",256,256],
  ["CAMELLIA128-SHA","TLSv1/SSLv3",128,128],
  ["CAMELLIA256-SHA","TLSv1/SSLv3",256,256],
  ["DES-CBC3-SHA","TLSv1/SSLv3",168,168],
  ["DES-CBC-SHA","TLSv1/SSLv3",56,56],
  ["DHE-DSS-AES128-GCM-SHA256","TLSv1/SSLv3",128,128],
  ["DHE-DSS-AES128-SHA256","TLSv1/SSLv3",128,128],
  ["DHE-DSS-AES128-SHA","TLSv1/SSLv3",128,128],
  ["DHE-DSS-AES256-GCM-SHA384","TLSv1/SSLv3",256,256],
  ["DHE-DSS-AES256-SHA256","TLSv1/SSLv3",256,256],
  ["DHE-DSS-AES256-SHA","TLSv1/SSLv3",256,256],
  ["DHE-DSS-CAMELLIA128-SHA","TLSv1/SSLv3",128,128],
  ["DHE-DSS-CAMELLIA256-SHA","TLSv1/SSLv3",256,256],
  ["DHE-DSS-SEED-SHA","TLSv1/SSLv3",128,128],
  ["DHE-RSA-AES128-GCM-SHA256","TLSv1/SSLv3",128,128],
  ["DHE-RSA-AES128-SHA256","TLSv1/SSLv3",128,128],
  ["DHE-RSA-AES128-SHA","TLSv1/SSLv3",128,128],
  ["DHE-RSA-AES256-GCM-SHA384","TLSv1/SSLv3",256,256],
  ["DHE-RSA-AES256-SHA256","TLSv1/SSLv3",256,256],
  ["DHE-RSA-AES256-SHA","TLSv1/SSLv3",256,256],
  ["DHE-RSA-CAMELLIA128-SHA","TLSv1/SSLv3",128,128],
  ["DHE-RSA-CAMELLIA256-SHA","TLSv1/SSLv3",256,256],
  ["DHE-RSA-SEED-SHA","TLSv1/SSLv3",128,128],
  ["ECDH-ECDSA-AES128-GCM-SHA256","TLSv1/SSLv3",128,128],
  ["ECDH-ECDSA-AES128-SHA256","TLSv1/SSLv3",128,128],
  ["ECDH-ECDSA-AES128-SHA","TLSv1/SSLv3",128,128],
  ["ECDH-ECDSA-AES256-GCM-SHA384","TLSv1/SSLv3",256,256],
  ["ECDH-ECDSA-AES256-SHA384","TLSv1/SSLv3",256,256],
  ["ECDH-ECDSA-AES256-SHA","TLSv1/SSLv3",256,256],
  ["ECDH-ECDSA-DES-CBC3-SHA","TLSv1/SSLv3",168,168],
  ["ECDH-ECDSA-RC4-SHA","TLSv1/SSLv3",128,128],
  ["ECDHE-ECDSA-AES128-GCM-SHA256","TLSv1/SSLv3",128,128],
  ["ECDHE-ECDSA-AES128-SHA256","TLSv1/SSLv3",128,128],
  ["ECDHE-ECDSA-AES128-SHA","TLSv1/SSLv3",128,128],
  ["ECDHE-ECDSA-AES256-GCM-SHA384","TLSv1/SSLv3",256,256],
  ["ECDHE-ECDSA-AES256-SHA384","TLSv1/SSLv3",256,256],
  ["ECDHE-ECDSA-AES256-SHA","TLSv1/SSLv3",256,256],
  ["ECDHE-ECDSA-DES-CBC3-SHA","TLSv1/SSLv3",168,168],
  ["ECDHE-ECDSA-RC4-SHA","TLSv1/SSLv3",128,128],
  ["ECDHE-RSA-AES128-GCM-SHA256","TLSv1/SSLv3",128,128],
  ["ECDHE-RSA-AES128-SHA256","TLSv1/SSLv3",128,128],
  ["ECDHE-RSA-AES128-SHA","TLSv1/SSLv3",128,128],
  ["ECDHE-RSA-AES256-GCM-SHA384","TLSv1/SSLv3",256,256],
  ["ECDHE-RSA-AES256-SHA384","TLSv1/SSLv3",256,256],
  ["ECDHE-RSA-AES256-SHA","TLSv1/SSLv3",256,256],
  ["ECDHE-RSA-DES-CBC3-SHA","TLSv1/SSLv3",168,168],
  ["ECDHE-RSA-RC4-SHA","TLSv1/SSLv3",128,128],
  ["ECDH-RSA-AES128-GCM-SHA256","TLSv1/SSLv3",128,128],
  ["ECDH-RSA-AES128-SHA256","TLSv1/SSLv3",128,128],
  ["ECDH-RSA-AES128-SHA","TLSv1/SSLv3",128,128],
  ["ECDH-RSA-AES256-GCM-SHA384","TLSv1/SSLv3",256,256],
  ["ECDH-RSA-AES256-SHA384","TLSv1/SSLv3",256,256],
  ["ECDH-RSA-AES256-SHA","TLSv1/SSLv3",256,256],
  ["ECDH-RSA-DES-CBC3-SHA","TLSv1/SSLv3",168,168],
  ["ECDH-RSA-RC4-SHA","TLSv1/SSLv3",128,128],
  ["EDH-DSS-DES-CBC3-SHA","TLSv1/SSLv3",168,168],
  ["EDH-DSS-DES-CBC-SHA", "TLSv1/SSLv3", 56, 56],
  ["EDH-DSS-DES-CBC-SHA","TLSv1/SSLv3",56,56],
  ["EDH-RSA-DES-CBC3-SHA","TLSv1/SSLv3",168,168],
  ["EDH-RSA-DES-CBC-SHA","TLSv1/SSLv3",56,56],
  ["EXP-DES-CBC-SHA","TLSv1/SSLv3",40,56],
  ["EXP-EDH-DSS-DES-CBC-SHA","TLSv1/SSLv3",40,56],
  ["EXP-EDH-RSA-DES-CBC-SHA","TLSv1/SSLv3",40,56],
  ["EXP-RC2-CBC-MD5","TLSv1/SSLv3",40,128],
  ["EXP-RC4-MD5", "TLSv1/SSLv3", 40, 128],
  ["PSK-3DES-EDE-CBC-SHA","TLSv1/SSLv3",168,168],
  ["PSK-AES128-CBC-SHA","TLSv1/SSLv3",128,128],
  ["PSK-AES256-CBC-SHA","TLSv1/SSLv3",256,256],
  ["PSK-RC4-SHA","TLSv1/SSLv3",128,128],
  ["RC4-MD5","TLSv1/SSLv3",128,128],
  ["RC4-SHA","TLSv1/SSLv3",128,128],
  ["SEED-SHA","TLSv1/SSLv3",128,128],
  ["SRP-DSS-3DES-EDE-CBC-SHA","TLSv1/SSLv3",168,168],
  ["SRP-DSS-AES-128-CBC-SHA","TLSv1/SSLv3",128,128],
  ["SRP-DSS-AES-256-CBC-SHA","TLSv1/SSLv3",256,256],
  ["SRP-RSA-3DES-EDE-CBC-SHA","TLSv1/SSLv3",168,168],
  ["SRP-RSA-AES-128-CBC-SHA","TLSv1/SSLv3",128,128],
  ["SRP-RSA-AES-256-CBC-SHA","TLSv1/SSLv3",256,256],
]
CIPHERS_OPENSSL =

SSL cipher lists used can be in several different formats. One format is a simple Array of strings listing the cipher names. That format is used here.

This list was generated using the 'openssl ciphers' command. The openssl version was: OpenSSL 1.0.2g 1 Mar 2016

The specific command used to generate this list was:

openssl ciphers -v 'DEFAULT:!RC4:!SSLv2:HIGH:@STRENGTH' | cut -d“ ” -f1 | sed 's/^/t“/;s/$/”,/'

[
  "ECDHE-RSA-AES256-GCM-SHA384",
  "ECDHE-ECDSA-AES256-GCM-SHA384",
  "ECDHE-RSA-AES256-SHA384",
  "ECDHE-ECDSA-AES256-SHA384",
  "ECDHE-RSA-AES256-SHA",
  "ECDHE-ECDSA-AES256-SHA",
  "SRP-DSS-AES-256-CBC-SHA",
  "SRP-RSA-AES-256-CBC-SHA",
  "SRP-AES-256-CBC-SHA",
  "DH-DSS-AES256-GCM-SHA384",
  "DHE-DSS-AES256-GCM-SHA384",
  "DH-RSA-AES256-GCM-SHA384",
  "DHE-RSA-AES256-GCM-SHA384",
  "DHE-RSA-AES256-SHA256",
  "DHE-DSS-AES256-SHA256",
  "DH-RSA-AES256-SHA256",
  "DH-DSS-AES256-SHA256",
  "DHE-RSA-AES256-SHA",
  "DHE-DSS-AES256-SHA",
  "DH-RSA-AES256-SHA",
  "DH-DSS-AES256-SHA",
  "DHE-RSA-CAMELLIA256-SHA",
  "DHE-DSS-CAMELLIA256-SHA",
  "DH-RSA-CAMELLIA256-SHA",
  "DH-DSS-CAMELLIA256-SHA",
  "ECDH-RSA-AES256-GCM-SHA384",
  "ECDH-ECDSA-AES256-GCM-SHA384",
  "ECDH-RSA-AES256-SHA384",
  "ECDH-ECDSA-AES256-SHA384",
  "ECDH-RSA-AES256-SHA",
  "ECDH-ECDSA-AES256-SHA",
  "AES256-GCM-SHA384",
  "AES256-SHA256",
  "AES256-SHA",
  "CAMELLIA256-SHA",
  "PSK-AES256-CBC-SHA",
  "ECDHE-RSA-AES128-GCM-SHA256",
  "ECDHE-ECDSA-AES128-GCM-SHA256",
  "ECDHE-RSA-AES128-SHA256",
  "ECDHE-ECDSA-AES128-SHA256",
  "ECDHE-RSA-AES128-SHA",
  "ECDHE-ECDSA-AES128-SHA",
  "SRP-DSS-AES-128-CBC-SHA",
  "SRP-RSA-AES-128-CBC-SHA",
  "SRP-AES-128-CBC-SHA",
  "DH-DSS-AES128-GCM-SHA256",
  "DHE-DSS-AES128-GCM-SHA256",
  "DH-RSA-AES128-GCM-SHA256",
  "DHE-RSA-AES128-GCM-SHA256",
  "DHE-RSA-AES128-SHA256",
  "DHE-DSS-AES128-SHA256",
  "DH-RSA-AES128-SHA256",
  "DH-DSS-AES128-SHA256",
  "DHE-RSA-AES128-SHA",
  "DHE-DSS-AES128-SHA",
  "DH-RSA-AES128-SHA",
  "DH-DSS-AES128-SHA",
  "DHE-RSA-SEED-SHA",
  "DHE-DSS-SEED-SHA",
  "DH-RSA-SEED-SHA",
  "DH-DSS-SEED-SHA",
  "DHE-RSA-CAMELLIA128-SHA",
  "DHE-DSS-CAMELLIA128-SHA",
  "DH-RSA-CAMELLIA128-SHA",
  "DH-DSS-CAMELLIA128-SHA",
  "ECDH-RSA-AES128-GCM-SHA256",
  "ECDH-ECDSA-AES128-GCM-SHA256",
  "ECDH-RSA-AES128-SHA256",
  "ECDH-ECDSA-AES128-SHA256",
  "ECDH-RSA-AES128-SHA",
  "ECDH-ECDSA-AES128-SHA",
  "AES128-GCM-SHA256",
  "AES128-SHA256",
  "AES128-SHA",
  "SEED-SHA",
  "CAMELLIA128-SHA",
  "PSK-AES128-CBC-SHA",
  "ECDHE-RSA-DES-CBC3-SHA",
  "ECDHE-ECDSA-DES-CBC3-SHA",
  "SRP-DSS-3DES-EDE-CBC-SHA",
  "SRP-RSA-3DES-EDE-CBC-SHA",
  "SRP-3DES-EDE-CBC-SHA",
  "EDH-RSA-DES-CBC3-SHA",
  "EDH-DSS-DES-CBC3-SHA",
  "DH-RSA-DES-CBC3-SHA",
  "DH-DSS-DES-CBC3-SHA",
  "ECDH-RSA-DES-CBC3-SHA",
  "ECDH-ECDSA-DES-CBC3-SHA",
  "DES-CBC3-SHA",
  "PSK-3DES-EDE-CBC-SHA",
]
HAND_SHAKE_DATA =
"\x15\x03\x03\x00\x02\x02\n"
URL_REPAT =

stomp URL regex pattern, for e.g. login:[email protected]:port or host:port

'((([\[email protected]#$%^&*()\-+=.?:<>,.]*\w):([\[email protected]#$%^&*()\-+=.?:<>,.]*))[email protected])?([\w\.\-]+):(\d+)'
FAILOVER_REGEX =

Failover URL regex, for e.g. failover:(stomp+ssl://login1:[email protected]:61612,stomp://login2:[email protected]:61613)

/^failover:(\/\/)?\(stomp(\+ssl)?:\/\/#{URL_REPAT}(,stomp(\+ssl)?:\/\/#{URL_REPAT})*\)(\?(.*))?$/