Hello everyone,
I used `@novnc/novnc": "^1.4.0` and `websockify v0.8.0` in an Angular app v14, i ran the command:
```npm run websockify localhost:6080 localhost:5901```
In app.component.ts i have added this:
```
import { Component } from "@angular/core";
import RFB from "../../node_modules/@novnc/novnc/core/rfb.js";
@Component({
selector: "app-root",
templateUrl: "./app.component.html",
styleUrls: ["./app.component.css"],
})
export class AppComponent {
title = "vnc-client";
public rfb: RFB;
startClient() {
console.log("Starting !!!");
// Read parameters specified in the URL query string
// By default, use the host and port of server that served this file
const host = window.location.hostname;
const port = "6080";
const password = "foobar"; // password of your vnc server
const path = "websockify";
// Build the websocket URL used to connect
let url = "ws";
if (window.location.protocol === "https:") {
url = "wss";
} else {
url = "ws";
}
url += "://" + host;
if (port) {
url += ":" + port;
}
url += "/" + path;
console.log("URL: ", url);
// Creating a new RFB object will start a new connection
this.rfb = new RFB(document.getElementById("screen"), url, {
credentials: { password: password },
});
}
}
```
but i have this error in console:
```rfb.js:941 Failed when connecting: Connection closed (code: 1005)```