Ylianst / MeshCentral

A complete web-based remote monitoring and management web site. Once setup you can install agents and perform remote desktop session to devices on the local network or over the Internet.
https://meshcentral.com
Apache License 2.0
4.26k stars 569 forks source link

error to connect novnc from another computer. #5580

Open marcos1500 opened 11 months ago

marcos1500 commented 11 months ago

Describe the bug As per the image, on the website, I provided a link for direct access to NoVNC through the following link. 2023-11-25 01 36 33

link on webpage: " "

I configured the sample-config.json file with the following setting: "_redirPortBind": "10.0.0.226"

However, when I try to access NoVNC, the following error occurs:

"NoVNC encountered an error:"

NS_ERROR_CONTENT_BLOCKED: https://10.0.0.226/novnc/core/websock.js:231:0 open@https://10.0.0.226/novnc/core/websock.js:231:21 _connect@https://10.0.0.226/novnc/core/rfb.js:551:24 _updateConnectionState@https://10.0.0.226/novnc/core/rfb.js:903:22 RFB@https://10.0.0.226/novnc/core/rfb.js:279:14 connect@https://10.0.0.226/novnc/app/ui.js:1060:18

"But if I remove the "_redirPortBind": "10.0.0.226", I won't be able to access NoVNC from other computers."

Server Software (please complete the following information):

Client Device (please complete the following information):

Your config.json file

{
  "$schema": "https://raw.githubusercontent.com/Ylianst/MeshCentral/master/meshcentral-config-schema.json",
  "__comment1__": "This is a simple configuration file, all values and sections that start with underscore (_) are ignored. Edit a section and remove the _ in front of the name. Refer to the user's guide for details.",
  "__comment2__": "See node_modules/meshcentral/sample-config-advanced.json for a more advanced example.",
  "settings": {
    "_cert": "myserver.mydomain.com",
    "_WANonly": true,
    "_LANonly": true,
    "_sessionKey": "MyReallySecretPassword1",
    "_port": 443,
    "_aliasPort": 443,
    "_redirPort": 80,
    "_redirAliasPort": 80,  
    "_redirPortBind": "10.0.0.226"
  },
  "domains": {
    "": {
      "_title": "MyServer",
      "_title2": "Servername",
      "_minify": true,
      "_newAccounts": true,
      "_userNameIsEmail": true
    }
  },
  "_letsencrypt": {
    "__comment__": "Requires NodeJS 8.x or better, Go to https://letsdebug.net/ first before trying Let's Encrypt.",
    "email": "myemail@mydomain.com",
    "names": "myserver.mydomain.com",
    "skipChallengeVerification": true,
    "production": false
  }
}
CapriPL commented 11 months ago

According to documentation: "redirPort - This is a HTTP web server port that mostly redirects users to the HTTPS port but does provide some other services." Configure "relayPort" on the MC server, for the NoVNC client to work properly, you must also have a VNC server running on the computers you want to connect to.

Regards, G.

si458 commented 11 months ago

Anything with an _ infront of it is ignored Try removing the _ part

si458 commented 1 month ago

is this still an issue? looking at your screenshot, you are setting the ws url to localhost and it needs to be set as your meshcentral dns name! also the ws url needs to be URl encoded when you open it, not passed directly decoded

example https://mc.myserver.com/novnc/vnc.html?ws=wss%3A%2F%2Fmc.myserver.com%2Fmeshrelay.ashx%3Fauth%3DzrmyazFhU2nBtD1kvgE7DBLONGASSAUTHTOKENSHOULDAPPEARHERE&show_dot=1&l=en&name=rpi3bscreen