Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion images/chromium-headful/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ RUN set -eux; \
make -j$(nproc); \
make install;

FROM ghcr.io/onkernel/neko/base:3.0.6-v1.0 AS neko
FROM ghcr.io/onkernel/neko/base:3.0.6-v1.0.1 AS neko
# ^--- now has event.SYSTEM_PONG with legacy support to keepalive
FROM docker.io/ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive
Expand Down
3 changes: 2 additions & 1 deletion images/chromium-headful/client/src/neko/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const EVENT = {
INIT: 'system/init',
DISCONNECT: 'system/disconnect',
ERROR: 'system/error',
PONG: 'system/pong',
},
CLIENT: {
HEARTBEAT: 'client/heartbeat',
Expand Down Expand Up @@ -90,7 +91,7 @@ export type ControlEvents =
| typeof EVENT.CONTROL.CLIPBOARD
| typeof EVENT.CONTROL.KEYBOARD

export type SystemEvents = typeof EVENT.SYSTEM.DISCONNECT
export type SystemEvents = typeof EVENT.SYSTEM.DISCONNECT | typeof EVENT.SYSTEM.PONG
export type ClientEvents = typeof EVENT.CLIENT.HEARTBEAT
export type MemberEvents = typeof EVENT.MEMBER.LIST | typeof EVENT.MEMBER.CONNECTED | typeof EVENT.MEMBER.DISCONNECTED

Expand Down
6 changes: 4 additions & 2 deletions images/chromium-headful/client/src/neko/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ export class NekoClient extends BaseClient implements EventEmitter<NekoEvents> {
this._ws_heartbeat = window.setInterval(() => {
this.emit('debug', `sending client/heartbeat`)
this.sendMessage(EVENT.CLIENT.HEARTBEAT)
this.emit('debug', `sending chat/message`)
this.sendMessage(EVENT.CHAT.MESSAGE, { content: `heartbeat/fake [${Date.now()}]` })
}, heartbeat_interval * 1000)
}
}
Expand Down Expand Up @@ -183,6 +181,10 @@ export class NekoClient extends BaseClient implements EventEmitter<NekoEvents> {
})
}

protected [EVENT.SYSTEM.PONG]({ timestamp }: { timestamp: string }) {
// this.emit('debug', `received system/pong with timestamp: ${timestamp}`)
}

/////////////////////////////
// Member Events
/////////////////////////////
Expand Down
10 changes: 10 additions & 0 deletions images/chromium-headful/client/src/neko/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export type WebSocketMessages =
| ScreenResolutionMessage
| ScreenConfigurationsMessage
| ChatMessage
| SystemPongMessage

export type WebSocketPayloads =
| SignalProvidePayload
Expand All @@ -45,6 +46,7 @@ export type WebSocketPayloads =
| AdminLockPayload
| BroadcastStatusPayload
| BroadcastCreatePayload
| SystemPongPayload

export interface WebSocketMessage {
event: WebSocketEvents | string
Expand Down Expand Up @@ -74,6 +76,14 @@ export interface SystemMessagePayload {
message: string
}

// system/pong
export interface SystemPongMessage extends WebSocketMessage, SystemPongPayload {
event: typeof EVENT.SYSTEM.PONG
}
export interface SystemPongPayload {
timestamp: string
}

/*
SIGNAL MESSAGES/PAYLOADS
*/
Expand Down
2 changes: 1 addition & 1 deletion images/chromium-headful/neko.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ plugins:
enabled: false

chat:
enabled: true
enabled: false

filetransfer:
enabled: false
Loading