Add host for WS

This commit is contained in:
mhsanaei
2024-04-01 17:02:02 +04:30
parent 44b7eb881c
commit 4e20bb5f02
5 changed files with 50 additions and 10 deletions
+2
View File
@@ -194,6 +194,7 @@ class WsStreamSettings extends CommonClass {
static fromJson(json={}) {
return new WsStreamSettings(
json.path,
json.host,
json.headers && !ObjectUtil.isEmpty(json.headers.Host) ? json.headers.Host : '',
);
}
@@ -201,6 +202,7 @@ class WsStreamSettings extends CommonClass {
toJson() {
return {
path: this.path,
host: this.host,
headers: ObjectUtil.isEmpty(this.host) ? undefined : {Host: this.host},
};
}