Connect
Message to authenticate and negotiate connection parameters.
Request
In the Thinger.io server implementation, there are the following default values and parameters:
Field | Type | Required | Value |
---|---|---|---|
Stream Id (0x01) | varint | Connect stream identifier | |
Parameters (0x02) | varint | 1: Payload contains an array with username, device, and credentials 2: Auth Info contains a string with a token. Default: 1 (Username/Password Credentials) | |
Payload (0x03) | any | Parameter with value 1: Auth Info contains an array with ["username", "device", "credential"]. Parameter with value 2: Auth Info contains a string with a token. | |
Keep Alive Interval (0x04) | varint | Number of expected seconds between keep alives. Default: 60 seconds | |
Payload Encoding (0x05) | any | 0x00: Reserved 0x01: PSON 0x02: JSON 0x03: MessagePack 0x04: BSON 0x05: CBOR 0x06: UBJSON Default: 0x01 (PSON) |
Response
OK
Field | Type | Description |
OK | Parameters: None Payload: None | The server agree the Connect |
Error
Error | Parameter | Payload | Description |
---|---|---|---|
Unknown | N/A | N/A | The server refuses the connection. |
Redirect | 1 | Target server redirect | The server requires the device to connect to another host, i.e., for load balancing, route to a nearest host, etc. Examples: iotmp://newserver.io iotmps://newserver.io |
Bad Credentials | 2 | The provided credentials are not valid in the server. | |
Invalid Keep Alive | 3 | The negotiated keep-alive is incorrect. | |
Bad Encoding | 4 | The negotiated encoding is not supported by the server. |
Last updated