[Possibly this should be in the FAQ. It doesn't come up very
often on the list, but two or three people have sent me
emails directly. I'll add it to my VNC page as well.]

"Keyur M. Parekh" wrote:
> 
> Hi Joseph,
> 
> I was searching the VNC mailing list archives for help with firewall
> issues and I came across your post and then I checked our your page. I
> was wondering if maybe you could help me out.
> 
> Here is the basic information:
> 
> Server - Direct to Internet
> Viewing - always will be via the HTTP interface from WITHIN a firewall
> 
> If I install your path or use your patched exe the only port used will
> be 5900 by default, is that right?
> 
> Now the thing is I know that ports 2000 through 2010 are open over TCP.
> Can you show me an example of what I can put into the display number box
> in the WinVNC's server's Current User Properties dialog to get the
> server
> to talk to the viewer applet at any of the ports from 2000 to 2001. This
> is with your patch applied.
> 
> Thanks so much Joseph. I really appreciate your help.

OK, we want to connect to port (say) 2001. Since the port number is
5900+display number, that means we need to connect to display
-3899. You can't enter negative numbers, but you *can* enter a number
that is large enough to overflow the 16-bit port number when 5900
is added, and thereby result in the correct port number. This
works because WinVNC stores the port number as a 32-bit value,
and truncates it to 16 bits when it's actually used.

If you want to use the WinVNC propertied page to do it, then
for port 2001, the correct number is 65536-5900+2001 = 61637, so
enter 61637 in the WinVNC properties "Display Number" field. (Note,
65536 is 2 to the 16th power, which, when truncated to a 16-bit
value, is 0).

The WinVNC viewer seems to take display numbers outside of the
expected range (which is? I'm guessing 0-99) to be port numbers,
so to connect in this manner you can just use "hostname:2001".
Or you can use 61637+5900 = 67537: "hostname:67537". Same result.

If you want to use port 80, you need 65536-5900+80 = 59716 in the
WinVNC "Display Number" field, and connect to 65536+80 =
"hostname:65616". Note that in this case you *must* use
the large port number, since "hostname:80" would cause the viewer
to connect to port 5980.

You can also use REGEDIT.EXE to directly install the desired port
number in \\HKEY_CURRENT_USER\Software\ORL\WinVNC3\PortNumber - that
is, you can enter decimal 2001 in that location to make WinVNC listen
on port 2001; no arithmetic required.

I have tested all this, confirmed that it works, and sniffed the
network to be sure the correct port is used. Let me know if you
have any trouble.

Good luck,

-- Joe


-- Joe Knapka
"It was just a maddened crocodile hidden in a flower bed. It could
 have happened to anyone." -- Pratchett
// Linux MM Documentation in progress:
// http://home.earthlink.net/~jknapka/linux-mm/vmoutline.html
* Evolution is an "unproven theory" in the same sense that gravity is. *
---------------------------------------------------------------------
To unsubscribe, send a message with the line: unsubscribe vnc-list
to [EMAIL PROTECTED]
See also: http://www.uk.research.att.com/vnc/intouch.html
---------------------------------------------------------------------

Reply via email to