diff options
| author | Shulhan <ms@kilabit.info> | 2022-04-20 16:59:54 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2022-04-20 17:00:13 +0700 |
| commit | a07e433b49330b5e2daef37f1d1f4055a88e1615 (patch) | |
| tree | ef81fba28541e808543f43424cfb1bc7645e7e56 | |
| parent | 3aad4d9316e9011d4d55c877b4ee0689e682091d (diff) | |
| download | pakakeh.ts-a07e433b49330b5e2daef37f1d1f4055a88e1615.tar.xz | |
all: accept the address options as is
This remove the insecure option since in the browser, the WebSocket
client does not have an option to ignore invalid certificate (the user
must accept the invalid certificate by them self).
| -rw-r--r-- | websocket_client.d.ts | 1 | ||||
| -rw-r--r-- | websocket_client.ts | 7 |
2 files changed, 1 insertions, 7 deletions
diff --git a/websocket_client.d.ts b/websocket_client.d.ts index 737fb21..00eb4c1 100644 --- a/websocket_client.d.ts +++ b/websocket_client.d.ts @@ -6,7 +6,6 @@ interface RequestQueue { } export interface WuiWebSocketOptions { address: string; - insecure: boolean; auto_reconnect: boolean; auto_reconnect_interval: number; onBroadcast: (res: WuiWebSocketResponse) => void; diff --git a/websocket_client.ts b/websocket_client.ts index 092ea86..ded53b2 100644 --- a/websocket_client.ts +++ b/websocket_client.ts @@ -13,7 +13,6 @@ interface RequestQueue { export interface WuiWebSocketOptions { address: string - insecure: boolean // If true the client will connect without SSL. auto_reconnect: boolean // If true the client will handle auto-reconnect. auto_reconnect_interval: number // The interval for auto-reconnect, default to 5 seconds. onBroadcast: (res: WuiWebSocketResponse) => void @@ -45,11 +44,7 @@ export class WuiWebSocketClient { error: string = "" constructor(public opts: WuiWebSocketOptions) { - if (opts.insecure) { - this.address = "ws://" + opts.address - } else { - this.address = "wss://" + opts.address - } + this.address = opts.address if (opts.auto_reconnect) { if (opts.auto_reconnect_interval <= 0) { opts.auto_reconnect_interval = |
