How to use the @novnc/novnc function in @novnc/novnc

To help you get started, we’ve selected a few @novnc/novnc 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 kvdi / kvdi / ui / app / src / lib / displays.js View on Github external
async _connect(view, displayUrl) {
        if (this._rfbClient) { 
            console.log('An RFB client already appears to be connected, returning')
            return 
        }
        console.log('Creating RFB connection')
        this._rfbClient = new RFB(view, displayUrl)
        this._rfbClient.addEventListener('connect', (ev) => { this._connectedToRFBServer(ev) })
        this._rfbClient.addEventListener('disconnect', (ev) => { this._disconnectedFromRFBServer(ev) })
        this._rfbClient.addEventListener('clipboard', (ev) => { this._handleRecvClipboard(ev) })
        this._rfbClient.resizeSession = true
        this._rfbClient.scaleViewport = true
    }
github ovh / manager / packages / manager / modules / vps / src / modal / shortcut / kvm / novnc / novnc.controller.js View on Github external
$onInit() {
    this.connected = false;
    this.status = STATUS_CONNECTING;

    const rfbUrl = `wss://${this.host}:${this.port}/`;

    const rfbConfig = {
      credentials: {
        password: this.password,
      },
      wsProtocols: ['binary', 'base64'],
      shared: true,
      repeaterID: '',
    };

    this.rfb = new RFB(
      document.getElementById('noVNC_screen'),
      rfbUrl,
      rfbConfig,
    );

    this.rfb.addEventListener('connect', () => {
      this.rfb.background = '#000';
      this.$timeout(() => {
        this.connected = true;
        this.status = STATUS_CONNECTED;
      });
    });

    this.rfb.addEventListener('disconnect', () => {
      this.$timeout(() => {
        this.connected = false;

@novnc/novnc

An HTML5 VNC client

MPL-2.0
Latest version published 5 months ago

Package Health Score

86 / 100
Full package analysis