How to use the socket.io-client function in socket

To help you get started, we’ve selected a few socket examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mockstarjs / mockstar / packages / mockstar-client / src / model / SocketClient.js View on Github external
constructor(url) {
        this.url = url || 'http://local.mockstarjs.org';

        this.socket = io(this.url);

        // 序列号,用于识别不同的事件
        this._seq = 0;

        this.init();
    }
github kube-HPC / hkube / core / algorithm-builder / environments / nodejs / lib / adapters / socketio.js View on Github external
_connect() {
        this._socket = socketio(this._url);
        this._registerSocketMessages(this._socket);
    }
github michaelwilcox / ruscello / lib / js / utils / ruscello-web-api.ts View on Github external
constructor() {
    this._socket = io('http://localhost:8080');
    this._actions = new Actions();
  }
github vibedrive / vibedrive / src / client / Services / fileserver.js View on Github external
this.promiseOfConnection = new Promise((resolve, reject) => {
      if (this.connected) return resolve()
      if (platform === 'electron') return reject(new Error('Wrong platform.'))

      this.socket = io('http://localhost:9753')

      this.socket.on('connect', () => {
        resolve()
      })

      this.emit = promisify(this.socket.emit).bind(this.socket)
    })
  }
github geli-lms / geli / app / webFrontend / src / app / shared / services / chat.service.ts View on Github external
public initSocket(room: string): void {
    this.socket = socketIo({
      path: '/chat',
      query: {
        room: room,
        authToken: this.authenticationService.token
      }
    });
  }

socket

CLI tool for Socket.dev

MIT
Latest version published 6 days ago

Package Health Score

78 / 100
Full package analysis