Solution: Java VNCviewer through SSH
Philip Andrew
Philip.Andrew "at" stanfordalumni.org
Tue, 10 Oct 2000 06:42:39 +0000
About a month ago I wrote about the following problem. Scroll down to the bottom for a
solution offered off-line by someone perusing the list archives. Perhaps the solution
could be patched into the next version of VNC, if deemed useful enough ...
> Problem: Has anyone tried running the WinVNC Java viewer client through SSH?
> I'm not able to -- details follow:
>
> I'm running on Windows 98, connecting to a VNC viewer on a Solaris box on the other
> side of my firewall (on display :26). I have my SSH session tunelling through the
> firewall, and forwarding ports 5826 and 5926 to my localhost's 5803 and 5903 ports.
>
> I have no problem running the native viewer on localhost:3, but if I try to browse
> to
>
> http://localhost:5803
>
> I only get as far as the "VNC Authentication" form. When I enter my password there,
> and click "OK", I get the error
>
> java.net.ConnectException: Connection refused
>
> However, when I browse to
>
> http://solarisbox:5826
>
> from INSIDE my firewall, it runs just fine ...
>
> Is there something else I have to open up for the Java connection to be established?
>
> I, myself, am not particularly hot to run the Java viewer, but I'm setting the
> system up for multiple users, and I want to give them as much flexibility as they
> need.
>
> Thanks!
>
> -Phil
Solution presented by Oliver Schindler <Oliver.Schindler "at" pd.admin.ch> (refer also to
attachment):
-------- Original Message --------
Subject: Re: Java VNCviewer through SSH
Date: Wed, 27 Sep 2000 14:59:50 +0200
From: Oliver.Schindler "at" pd.admin.ch
To: Philip.Andrew "at" stanfordalumni.org
Hallo Phil
First, sorry for my poor english... i hope you will understand what i trying
to tell *g*
You asked at the VNC mailing list: how to run the Java client through SSH
(i'm not member of the mailing list, but i saw your posting in the archive).
I tried running the Java Viewer through SSH myself this week. And I
got exactly the same problem as you. After a couple of hours, I figured
out how to get it work (maybe you have done this yourself by now).
There are at least two possibilities:
1st. Forward ports 58xx and 59xx to the same ports on your localhost
(example: forward ports 5826 and 5926 to your localhost's 5826 and 5926
ports)
2nd. Use my modified verson of index.vnc (i attached my version). The only
thing you have to do is: copy the index.vnc to your classes directory (for
instance /usr/local/vnc/classes)
Now let my explain, why it only works if you are using the same ports.
For better understanding have a look at the original index.vnc (it starts
the applet):
<!-- index.vnc - default html page for Java VNC viewer applet. On any file
ending in .vnc, the HTTP server embedded in Xvnc will substitute the
following variables when preceded by a dollar: USER, DESKTOP, DISPLAY,
APPLETWIDTH, APPLETHEIGHT, WIDTH, HEIGHT, PORT. Use two dollar signs
($$) to get a dollar sign in the generated html. -->
<HTML>
<TITLE>
$USER's $DESKTOP desktop ($DISPLAY)
</TITLE>
<APPLET CODE=vncviewer.class ARCHIVE=vncviewer.jar
WIDTH=$APPLETWIDTH HEIGHT=$APPLETHEIGHT>
<param name=PORT value=$PORT>
</APPLET>
</HTML>
As you can see, the variable $PORT is replaced through the port by Xvnc
(maybe you see now the problem!). Yes, the problem is: if you're running the
applet through SSH the port isn't 5926 for the applet (because the applet
has to connect your localhost on port 5903)!
The only thing I did was to modify the index.vnc so that it gets the port
from the url and sets the applet param to this value (of course you have to
add 100 to get the 59xx port).
regards
oliver
[demime 0.97b removed an attachment of type application/x-unknown-content-type-VncViewer]
---------------------------------------------------------------------
To unsubscribe, send a message with the line: unsubscribe vnc-list
to majordomo "at" uk.research.att.com
See also: http://www.uk.research.att.com/vnc/intouch.html
---------------------------------------------------------------------