mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
fix login and known hosts
This commit is contained in:
parent
6074d9d6e4
commit
a75abe1454
26 changed files with 618 additions and 96 deletions
|
|
@ -4,6 +4,7 @@ import { StatusEnum } from '../types/StatusEnum';
|
|||
import { KeepAliveService } from './KeepAliveService';
|
||||
import { CLIENT_OPTIONS } from '../config';
|
||||
import type { ConnectTarget } from '../types/WebClientConfig';
|
||||
import { buildWebSocketUrl } from '../utils/buildWebSocketUrl';
|
||||
|
||||
export interface ReconnectConfig {
|
||||
maxAttempts: number;
|
||||
|
|
@ -79,7 +80,7 @@ export class WebSocketService {
|
|||
this.keepalive = CLIENT_OPTIONS.keepalive;
|
||||
|
||||
const { host, port } = target;
|
||||
this.socket = this.createWebSocket(`${protocol}://${host}:${port}`);
|
||||
this.socket = this.createWebSocket(buildWebSocketUrl(protocol as 'ws' | 'wss', host, port));
|
||||
}
|
||||
|
||||
public disconnect(): void {
|
||||
|
|
@ -204,7 +205,9 @@ export class WebSocketService {
|
|||
return;
|
||||
}
|
||||
const { host, port } = this.lastTarget;
|
||||
this.socket = this.createWebSocket(`${this.lastProtocol}://${host}:${port}`);
|
||||
this.socket = this.createWebSocket(
|
||||
buildWebSocketUrl(this.lastProtocol as 'ws' | 'wss', host, port),
|
||||
);
|
||||
}, delay);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue