FD1 Client Protocol

FD1 Session Endpoint

A session is stateful details about your current connection, who you are, what open requests you have and so on.

For a websocket connection, there is one default session for the complete connection, and each "rt" (tab) can open a secondary session using fd1.session.login This is not recommended to be done.

fd1.session.login

Authenticates your client session to the server. This must be sent first when opening a websocket.

Fields

FieldDescription
apikeySends your APIKey.
tokenSends your token. Used for short term authentication
encryption_userBeta Testing.
Optional Fields
tzUsers timezone. Collected in browser using
tz: (new Date()).getTimezoneOffset()
localtime Users localtime. format "YYYY-MM-DD HH:mm:SS.ccc" Collected in browser using
let myDate = new Date()
localtime: myDate.getFullYear() + "-" + (myDate.getMonth() + 1)
                + "-" + myDate.getDate() + " " + myDate.getHours()
                + ":" + myDate.getMinutes() + ":" + myDate.getSeconds()
                + "." + myDate.getMilliseconds()
geo

fd1.session.login

  • Must provide one, and only one, of apikey, token, or encryption_user

Example

{
    a: "fd1.session.login",
    v: {
        apikey: "my api key",
        tz: myDate.getTimezoneOffset(),
        localtime: myDate.getFullYear() + "-" + (myDate.getMonth() + 1)
            + "-" + myDate.getDate() + " " + myDate.getHours()
            + ":" + myDate.getMinutes() + ":" + myDate.getSeconds()
            + "." + myDate.getMilliseconds()
    }
}

fd1.session.ignore

An endpoint that does absolutely nothing. The request is discarded. This can be used when using encrypted payloads to insert random padding into an encrypted message stream

fd1.session.cancel_request

Attempts to cancel a pending request. This is a best effort cancel and may not stop the request. The value "k" should be the "rq" to cancel

{
    a: "fd1....",
    rq: "my-request-1",
    ...
}

{
    a: "fd1.session.cancel_request",
    k: "my-request-1"
}