novnc / noVNC

VNC client web application
https://novnc.com
Other
11.68k stars 2.31k forks source link

Having trouble connecting #42

Closed msersen closed 13 years ago

msersen commented 13 years ago

Hello, I'm having trouble connecting with your VNC client. I am using tightvncserver. I have noVNC and it's dependencies installed. I am using dyndns to map the hostname lajik.dyndns.org:5956 to my machine. I am running Ubuntu 10.10 and attempting to log in with the latest Trunk of Minefield. I hope this would be all the info, please let me know if you need additional information. Thanks!

Here is the Console output...


sudo /home/msersen/Dropbox/Apps/kanaka-noVNC-bf5ee68/utils/launch.sh  --vnc LDPW:4 --web 5955 --proxy 5956
[sudo] password for msersen: 
Starting webserver on port 5955
Started webserver (pid: 10409)
Starting WebSockets proxy on port 5956
Waiting for connections on :5956
Started WebSockets proxy (pid: 10412)

Navigate to to this URL:

    http://LDPW:5955/vnc.html?host=LDPW&port=5956

Press Ctrl-C to exit

lajik.dyndns.org - - [04/Jan/2011 12:33:00] "GET /vnc.html?logging=debug HTTP/1.1" 200 -
lajik.dyndns.org - - [04/Jan/2011 12:33:00] "GET /include/plain.css HTTP/1.1" 200 -
lajik.dyndns.org - - [04/Jan/2011 12:33:00] "GET /include/vnc.js HTTP/1.1" 200 -
lajik.dyndns.org - - [04/Jan/2011 12:33:00] "GET /include/ui.js HTTP/1.1" 200 -
lajik.dyndns.org - - [04/Jan/2011 12:33:00] "GET /include/black.css HTTP/1.1" 200 -
lajik.dyndns.org - - [04/Jan/2011 12:33:00] "GET /include/util.js HTTP/1.1" 200 -
lajik.dyndns.org - - [04/Jan/2011 12:33:00] "GET /include/webutil.js HTTP/1.1" 200 -
lajik.dyndns.org - - [04/Jan/2011 12:33:00] "GET /include/base64.js HTTP/1.1" 200 -
lajik.dyndns.org - - [04/Jan/2011 12:33:00] "GET /include/des.js HTTP/1.1" 200 -
lajik.dyndns.org - - [04/Jan/2011 12:33:00] "GET /include/canvas.js HTTP/1.1" 200 -
lajik.dyndns.org - - [04/Jan/2011 12:33:00] "GET /include/rfb.js HTTP/1.1" 200 -
lajik.dyndns.org - - [04/Jan/2011 12:33:00] "GET /include/web-socket-js/swfobject.js HTTP/1.1" 200 -
lajik.dyndns.org - - [04/Jan/2011 12:33:00] "GET /include/web-socket-js/FABridge.js HTTP/1.1" 200 -
lajik.dyndns.org - - [04/Jan/2011 12:33:00] "GET /include/web-socket-js/web_socket.js HTTP/1.1" 200 -
  1: got client connection from 192.168.1.16
  1: forking handler process
  1: Sending flash policy response
  1: No connection after handshake
  2: got client connection from 192.168.1.16
  2: forking handler process
  2: using plain (not SSL) socket
  2: using protocol version 76
  2: connecting to: LDPW:4
  2: handler exception: [Errno 111] Connection refused
  3: got client connection from 192.168.1.16
  3: forking handler process
  3: handler exception: [Errno 336265218] _ssl.c:339: error:140B0002:SSL routines:SSL_CTX_use_PrivateKey_file:system lib
  4: got client connection from 192.168.1.16
  4: forking handler process
  4: handler exception: [Errno 336265218] _ssl.c:339: error:140B0002:SSL routines:SSL_CTX_use_PrivateKey_file:system lib
  5: got client connection from 192.168.1.16
  5: forking handler process
  5: handler exception: [Errno 336265218] _ssl.c:339: error:140B0002:SSL routines:SSL_CTX_use_PrivateKey_file:system lib
**********************************************************************************
and here is the FireBug debug output...
**************************************************************************************
">> RFB.init_ws"
"connecting to wss://LDPW:5956/"
"<< RFB.init_ws"
">> WebSocket.onclose"
"New state 'failed', was 'connect'. Msg: Server disconnected"
"Clearing connect timer"
"<< WebSocket.onclose"
"New state 'failed', was 'failed'."
"New state 'connect', was 'failed'."
">> RFB.init_ws"
"connecting to wss://LDPW:5956/"
"<< RFB.init_ws"
">> WebSocket.onclose"
"New state 'failed', was 'connect'. Msg: Server disconnected"
"Clearing connect timer"
"<< WebSocket.onclose"
"New state 'failed', was 'failed'."
kanaka commented 13 years ago

I think there are two problems.

First, the wsproxy is failing to connect to the VNC server target. I think you probably meant to start the proxy with --vnc LDPW:5904. The --vnc option uses actual port number, not VNC screen number.

Second, it looks like the certificate file is not being found to allow TLS/SSL connections. By default, wsproxy looks in the current directory for a file named 'self.pem'. If you launch wsproxy directly (rather than via the launch.sh script) you can use the --cert FILE option to specify a path to the cert file.

BTW, unless you are going to listen on a port that is < 1024, you really don't need to run launch.sh/wsproxy with as root (with sudo).

I just made a change to wsproxy so it is more clear when you start if wsproxy cannot find a certificate file.

msersen commented 13 years ago

Thank you, I will give it another go and see how it works. I thought it was odd that the SSL errors were being thrown; being that I do have my cert file in the same directory as wsproxy (Apps/kanaka-noVNC-bf5ee68/utils/self.pem/). Otherwise, I cannot connect with ssh turned off either.

kanaka commented 13 years ago

wsproxy searches for self.pem in the current directory (where you are running from) not the directory where wsproxy proxy is located (although they could be the same).

kanaka commented 13 years ago

I just pushed out an update to wsproxy that integrates a mini-webserver into the code. launch.sh will automatically start wsproxy with the web server. The --web and --proxy options for launch have been combined into the --listen option.

msersen commented 13 years ago

I updated my files, and I am happy to report that I did successfully manage to open a session. Here's the catch, I only connected from localhost... Although, I did so by calling on my registered domain name that points to my wan addy. As soon as I tried from outside the lan, I had less luck. What I can tell (from outside the LAN) is that I can pull up the login screen and I can browse directories. What is also strange (and I am not sure if it is how I set it up or not)... Is that I must enter a full path in the URL in order to reach the server ie. http://www.mydomain.dyndns.org:5955/home/user/Kanaka/vnc.html , whereas prior to the latest update I could reach the login screen w/o the entire path. I will keep you posted as I figure more out. There is also a but I may have uncovered but I'd like to test it a few more times before saying so for sure.

kanaka commented 13 years ago

msersen, I'm going to close this bug. If you are still having issues please re-open the bug and post the current status of the problem.