@zyzgroup/core-web 0.1.68 → 0.1.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21663,6 +21663,7 @@ class me {
21663
21663
  static CLOSED = WebSocket.CLOSED;
21664
21664
  // 3
21665
21665
  url;
21666
+ socketCreatorProtocols;
21666
21667
  socketCreatorOptions;
21667
21668
  socketCreator;
21668
21669
  socket;
@@ -21681,8 +21682,10 @@ class me {
21681
21682
  waitings = {};
21682
21683
  listeners = {};
21683
21684
  // wss://echo.websocket.org
21685
+ // wss://xinge.ruolin-link.com/
21686
+ // wss://tstxg.ruolin-link.com/
21684
21687
  constructor(t = "", e) {
21685
- this.url = t, this.socketCreatorOptions = e?.socketCreatorOptions || {}, this.socketCreator = e?.socketCreator || s0, this.pingInterval = e?.pingInterval || 5e3, this.onopen = e?.onopen, this.onclose = e?.onclose, this.onerror = e?.onerror, this.reconnect = typeof e?.reconnect == "boolean" ? e.reconnect : !0, this.maxReconnectAttempts = typeof e?.maxReconnectAttempts == "number" ? e.maxReconnectAttempts : 1 / 0, this._connect();
21688
+ this.url = t, this.socketCreatorProtocols = e?.socketCreatorProtocols, this.socketCreatorOptions = e?.socketCreatorOptions || {}, this.socketCreator = e?.socketCreator || s0, this.pingInterval = e?.pingInterval || 5e3, this.onopen = e?.onopen, this.onclose = e?.onclose, this.onerror = e?.onerror, this.reconnect = typeof e?.reconnect == "boolean" ? e.reconnect : !0, this.maxReconnectAttempts = typeof e?.maxReconnectAttempts == "number" ? e.maxReconnectAttempts : 1 / 0, this._connect();
21686
21689
  }
21687
21690
  open() {
21688
21691
  this._connect();
@@ -21691,7 +21694,11 @@ class me {
21691
21694
  this.state = me.CLOSING, this.socket?.close();
21692
21695
  }
21693
21696
  _connect() {
21694
- this.socket?.readyState === me.CONNECTING || this.socket?.readyState === me.OPEN || (this.state = me.CONNECTING, this.socket = this.socketCreator(this.url, [], this.socketCreatorOptions), this.socket.onopen = () => {
21697
+ this.socket?.readyState === me.CONNECTING || this.socket?.readyState === me.OPEN || (this.state = me.CONNECTING, this.socket = this.socketCreator(
21698
+ this.url,
21699
+ this.socketCreatorProtocols,
21700
+ this.socketCreatorOptions
21701
+ ), this.socket.onopen = () => {
21695
21702
  oe(`ws(${this.url}) onopen`), this.state = me.OPEN, this.reconnectTimerID && (clearTimeout(this.reconnectTimerID), this.reconnectTimerID = void 0, this.reconnectAttempts = 0), this.ping(), this.pingTimerID = setInterval(this.ping, this.pingInterval);
21696
21703
  const t = this.messageQueue.slice();
21697
21704
  this.messageQueue = [], t.forEach(this._send), this.onopen?.();