WebSocket: Add heartbeatPeriod

This commit is contained in:
mhsanaei
2024-12-03 22:07:58 +01:00
parent 462e02140d
commit 3e8fc59213
4 changed files with 20 additions and 2 deletions

View File

@@ -206,16 +206,23 @@ class KcpStreamSettings extends CommonClass {
}
class WsStreamSettings extends CommonClass {
constructor(path = '/', host = '') {
constructor(
path = '/',
host = '',
heartbeatPeriod = 0,
) {
super();
this.path = path;
this.host = host;
this.heartbeatPeriod = heartbeatPeriod;
}
static fromJson(json = {}) {
return new WsStreamSettings(
json.path,
json.host,
json.heartbeatPeriod,
);
}
@@ -223,6 +230,7 @@ class WsStreamSettings extends CommonClass {
return {
path: this.path,
host: this.host,
heartbeatPeriod: this.heartbeatPeriod
};
}
}