src/lib/cloud-provider.js
/**
     * Open a new websocket connection to the clouddata server.
     * @param {string} cloudHost The cloud data server to connect to.
     */
Open a new websocket connection to the clouddata server.
@param {string} cloudHost The cloud data server to connect to.
Open a new websocket connection to the clouddata server . @param { string } cloudHost The cloud data server to connect to .
openConnection (cloudHost) {
        if (window.WebSocket === null) {
            log.warn('Websocket support is not available in this browser');
            this.connection = null;
            return;
        }
        this.connection = new WebSocket((location.protocol === 'http:' ? 'ws://' : 'wss://') + cloudHost);
        this.connection.onerror = this.onError.bind(this);
        this.connection.onmessage = this.onMessage.bind(this);
        this.connection.onopen = this.onOpen.bind(this);
        this.connection.onclose = this.onClose.bind(this);
    }
openConnection ( cloudHost ) { if ( window . WebSocket === null ) { log . warn ( 'Websocket support is not available in this browser' ) ; this . connection = null ; return ; } this . connection = new WebSocket ( ( location . protocol === 'http:' ? 'ws://' : 'wss://' ) + cloudHost ) ; this . connection . onerror = this . onError . bind ( this ) ; this . connection . onmessage = this . onMessage . bind ( this ) ; this . connection . onopen = this . onOpen . bind ( this ) ; this . connection . onclose = this . onClose . bind ( this ) ; }
Open a new websocket connection to the clouddata server.
Open a new websocket connection to the clouddata server .