https://app.nokku.sh/nokku.v1.DaemonControlService/ConnectTry it
Header Parameters
Define the version of the Connect protocol
Define the timeout, in ms
Authorization
BearerAuth (bearer)
A service account token. Include it in the Authorization header: `Authorization: Bearer <token>`
CookieAuth (cookie: __Host-nokku_session)
The session cookie the web app uses. Browsers send it after sign-in. Only on `localhost` it is named `nokku_session`.
Request Body
RequiredAt most one of `heartbeat`, `connectionReport` may be set.
heartbeat?stateHash?The state_hash of the last sync the daemon saved, empty before the first. bytes.max_len = 64
connectionReport?ConnectionReport tells the core who logged in on the daemon's server and when they left. The daemon sends one report at a time and keeps its events until the ack. A report may so come twice, the core stores each event once.
events?dropped?Events the daemon threw away since its last report, because it could keep no more.
At most one of `heartbeat`, `connectionReport` may be set.
heartbeat?stateHash?The state_hash of the last sync the daemon saved, empty before the first. bytes.max_len = 64
connectionReport?ConnectionReport tells the core who logged in on the daemon's server and when they left. The daemon sends one report at a time and keeps its events until the ack. A report may so come twice, the core stores each event once.
events?dropped?Events the daemon threw away since its last report, because it could keep no more.
At most one of `heartbeat`, `connectionReport` may be set.
heartbeat?stateHash?The state_hash of the last sync the daemon saved, empty before the first. bytes.max_len = 64
connectionReport?ConnectionReport tells the core who logged in on the daemon's server and when they left. The daemon sends one report at a time and keeps its events until the ack. A report may so come twice, the core stores each event once.
events?dropped?Events the daemon threw away since its last report, because it could keep no more.
At most one of `heartbeat`, `connectionReport` may be set.
heartbeat?stateHash?The state_hash of the last sync the daemon saved, empty before the first. bytes.max_len = 64
connectionReport?ConnectionReport tells the core who logged in on the daemon's server and when they left. The daemon sends one report at a time and keeps its events until the ack. A report may so come twice, the core stores each event once.
events?dropped?Events the daemon threw away since its last report, because it could keep no more.
At most one of `heartbeat`, `connectionReport` may be set.
heartbeat?stateHash?The state_hash of the last sync the daemon saved, empty before the first. bytes.max_len = 64
connectionReport?ConnectionReport tells the core who logged in on the daemon's server and when they left. The daemon sends one report at a time and keeps its events until the ack. A report may so come twice, the core stores each event once.
events?dropped?Events the daemon threw away since its last report, because it could keep no more.
At most one of `heartbeat`, `connectionReport` may be set.
heartbeat?stateHash?The state_hash of the last sync the daemon saved, empty before the first. bytes.max_len = 64
connectionReport?ConnectionReport tells the core who logged in on the daemon's server and when they left. The daemon sends one report at a time and keeps its events until the ack. A report may so come twice, the core stores each event once.
events?dropped?Events the daemon threw away since its last report, because it could keep no more.
At most one of `heartbeat`, `connectionReport` may be set.
heartbeat?stateHash?The state_hash of the last sync the daemon saved, empty before the first. bytes.max_len = 64
connectionReport?ConnectionReport tells the core who logged in on the daemon's server and when they left. The daemon sends one report at a time and keeps its events until the ack. A report may so come twice, the core stores each event once.
events?dropped?Events the daemon threw away since its last report, because it could keep no more.
At most one of `heartbeat`, `connectionReport` may be set.
heartbeat?stateHash?The state_hash of the last sync the daemon saved, empty before the first. bytes.max_len = 64
connectionReport?ConnectionReport tells the core who logged in on the daemon's server and when they left. The daemon sends one report at a time and keeps its events until the ack. A report may so come twice, the core stores each event once.
events?dropped?Events the daemon threw away since its last report, because it could keep no more.
Responses
200Success
200Success
At most one of `stateUpdate`, `relayOpen`, `connectionReportAck` may be set.
stateUpdate?StateUpdate tells a daemon what it should hold. It syncs when its own hash differs, or when this one is empty.
stateHash?relayOpen?relayId?clientAddr?The user's address as the core saw it. The daemon's sshd reports it as the remote address of the relayed connection.
connectionReportAck?The core stored the report it got last.
At most one of `stateUpdate`, `relayOpen`, `connectionReportAck` may be set.
stateUpdate?StateUpdate tells a daemon what it should hold. It syncs when its own hash differs, or when this one is empty.
stateHash?relayOpen?relayId?clientAddr?The user's address as the core saw it. The daemon's sshd reports it as the remote address of the relayed connection.
connectionReportAck?The core stored the report it got last.
At most one of `stateUpdate`, `relayOpen`, `connectionReportAck` may be set.
stateUpdate?StateUpdate tells a daemon what it should hold. It syncs when its own hash differs, or when this one is empty.
stateHash?relayOpen?relayId?clientAddr?The user's address as the core saw it. The daemon's sshd reports it as the remote address of the relayed connection.
connectionReportAck?The core stored the report it got last.
At most one of `stateUpdate`, `relayOpen`, `connectionReportAck` may be set.
stateUpdate?StateUpdate tells a daemon what it should hold. It syncs when its own hash differs, or when this one is empty.
stateHash?relayOpen?relayId?clientAddr?The user's address as the core saw it. The daemon's sshd reports it as the remote address of the relayed connection.
connectionReportAck?The core stored the report it got last.
At most one of `stateUpdate`, `relayOpen`, `connectionReportAck` may be set.
stateUpdate?StateUpdate tells a daemon what it should hold. It syncs when its own hash differs, or when this one is empty.
stateHash?relayOpen?relayId?clientAddr?The user's address as the core saw it. The daemon's sshd reports it as the remote address of the relayed connection.
connectionReportAck?The core stored the report it got last.
At most one of `stateUpdate`, `relayOpen`, `connectionReportAck` may be set.
stateUpdate?StateUpdate tells a daemon what it should hold. It syncs when its own hash differs, or when this one is empty.
stateHash?relayOpen?relayId?clientAddr?The user's address as the core saw it. The daemon's sshd reports it as the remote address of the relayed connection.
connectionReportAck?The core stored the report it got last.
At most one of `stateUpdate`, `relayOpen`, `connectionReportAck` may be set.
stateUpdate?StateUpdate tells a daemon what it should hold. It syncs when its own hash differs, or when this one is empty.
stateHash?relayOpen?relayId?clientAddr?The user's address as the core saw it. The daemon's sshd reports it as the remote address of the relayed connection.
connectionReportAck?The core stored the report it got last.
At most one of `stateUpdate`, `relayOpen`, `connectionReportAck` may be set.
stateUpdate?StateUpdate tells a daemon what it should hold. It syncs when its own hash differs, or when this one is empty.
stateHash?relayOpen?relayId?clientAddr?The user's address as the core saw it. The daemon's sshd reports it as the remote address of the relayed connection.
connectionReportAck?The core stored the report it got last.
defaultError
defaultError
Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation
code?The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
message?A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
details?A list of messages that carry the error details. There is no limit on the number of messages.
Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation
code?The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
message?A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
details?A list of messages that carry the error details. There is no limit on the number of messages.
Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation
code?The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
message?A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
details?A list of messages that carry the error details. There is no limit on the number of messages.
Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation
code?The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
message?A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
details?A list of messages that carry the error details. There is no limit on the number of messages.
Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation
code?The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
message?A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
details?A list of messages that carry the error details. There is no limit on the number of messages.
Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation
code?The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
message?A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
details?A list of messages that carry the error details. There is no limit on the number of messages.
Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation
code?The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
message?A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
details?A list of messages that carry the error details. There is no limit on the number of messages.
Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation
code?The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
message?A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
details?A list of messages that carry the error details. There is no limit on the number of messages.
Code Samples
curl -X POST 'https://app.nokku.sh/nokku.v1.DaemonControlService/Connect' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/connect+json' \
-d '{
"heartbeat": {
"stateHash": "string"
},
"connectionReport": {
"events": [
{
"connectionId": "84b500d7-71c8-4b1f-adf4-f1eb0000973d",
"closed": true,
"time": "2023-01-15T01:30:15.01Z",
"principal": "string",
"keyId": "string",
"remoteAddr": "string",
"clientVersion": "string",
"relayed": true
}
],
"dropped": 0
}
}'const response = await fetch("https://app.nokku.sh/nokku.v1.DaemonControlService/Connect", {
method: "POST",
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/connect+json"
},
body: JSON.stringify({
"heartbeat": {
"stateHash": "string"
},
"connectionReport": {
"events": [
{
"connectionId": "84b500d7-71c8-4b1f-adf4-f1eb0000973d",
"closed": true,
"time": "2023-01-15T01:30:15.01Z",
"principal": "string",
"keyId": "string",
"remoteAddr": "string",
"clientVersion": "string",
"relayed": true
}
],
"dropped": 0
}
}),
});
const data = await response.json();
console.log(data);import requests
response = requests.request(
"POST",
"https://app.nokku.sh/nokku.v1.DaemonControlService/Connect",
headers={
"Authorization": "Bearer <token>"
},
json={
"heartbeat": {
"stateHash": "string"
},
"connectionReport": {
"events": [
{
"connectionId": "84b500d7-71c8-4b1f-adf4-f1eb0000973d",
"closed": True,
"time": "2023-01-15T01:30:15.01Z",
"principal": "string",
"keyId": "string",
"remoteAddr": "string",
"clientVersion": "string",
"relayed": True
}
],
"dropped": 0
}
},
)
print(response.json())package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"heartbeat": {
"stateHash": "string"
},
"connectionReport": {
"events": [
{
"connectionId": "84b500d7-71c8-4b1f-adf4-f1eb0000973d",
"closed": true,
"time": "2023-01-15T01:30:15.01Z",
"principal": "string",
"keyId": "string",
"remoteAddr": "string",
"clientVersion": "string",
"relayed": true
}
],
"dropped": 0
}
}`)
req, err := http.NewRequest("POST", "https://app.nokku.sh/nokku.v1.DaemonControlService/Connect", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/connect+json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(string(data))
}Example Responses
{
"stateUpdate": {
"stateHash": "string"
},
"relayOpen": {
"relayId": "string",
"clientAddr": "string"
},
"connectionReportAck": {}
}{
"code": "not_found",
"message": "string",
"details": [
{
"type": "string",
"value": "string",
"debug": {}
}
]
}