-
BTP URIs: btp+wss://:[email protected]:port/path
-
There is only one BTP version, but in the future we will likely add a subprotocol to the auth message that allows the client to advertise features and a subprotocol for the response that allows the server to acknowledge these features
-
Subprotocols either use the feature
-
The first protocol in the packet is called the primary
-
If the packet contains more than one protocol with the same name, reject the whole packet with a BTP error
-
If there are zero elements in protocol data, this is syntactically valid, although in the case of Message may return a BTP error
-
Nginx proxy statement for each peer
-
Plugins listen with unencrypted WebSocket by default
-
Make sure we use HSTS in ILP Kit
-
Auth primary protocol 'auth' - no data
-
Secondary protocol 'auth_token' - UTF-8: token
-
Secondary protocol 'auth_username' - UTF-8: username
-
If successful, server responds with empty response
-
If unsuccessful, server responds with BTP error and closes the connection
-
If client connects and doesn't send an auth packet within a timeout, the server closes the connection
-
If we need multi-user support, we'll add a subprotocol that can be attached to each message to indicate which user it is for
-
Clients should not have configure prefix and info
-
btp-packet should parse messages as follows:
- packetType: integer type
- ... other packet type fields
- primaryProtocol: string (primary protocol name)
- protocolData: object (parsed protocol data, each value is json -> object, utf-8 -> string, binary -> Buffer)
-
If you want the plugin to be a server, pass in a
listener
object -
If you want the plugin to be a client, pass in the
server
string which is a BTP uri -
If you want the plugin to be both, pass in both options
-
Not urgent, but eventually, in case of redundant sockets, one should be dropped
-
If you don't have an authenticated connection, the plugin will throw an error on any operation
-
To ensure a connection, first
await connect()
before making any requests -
When designing configuration options, put what it is, not what format it's in (e.g. 'server' instead of 'uri')
-
custom is a side protocol of type json, containing the entire custom object
-
can be a side protocol to ILP or its own primary protocol (on messages)
Created
September 18, 2017 19:16
-
-
Save justmoon/5eab07dff8ba0f15e413722045072e87 to your computer and use it in GitHub Desktop.
BTP Final Notes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment