aboutsummaryrefslogtreecommitdiff
path: root/websocket_client.ts
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-04-20 16:59:54 +0700
committerShulhan <ms@kilabit.info>2022-04-20 17:00:13 +0700
commita07e433b49330b5e2daef37f1d1f4055a88e1615 (patch)
treeef81fba28541e808543f43424cfb1bc7645e7e56 /websocket_client.ts
parent3aad4d9316e9011d4d55c877b4ee0689e682091d (diff)
downloadpakakeh.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).
Diffstat (limited to 'websocket_client.ts')
-rw-r--r--websocket_client.ts7
1 files changed, 1 insertions, 6 deletions
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 =