VNC FAQ-o-Matic : VNC and Firewalls : What TCP ports does VNC use?
By default, a VNC server will listen for connections from a VNC viewer on TCP port “5900+N”, where N is the “Display Number” (usually just zero). So a VNC server setup for Display-0 will listen on TCP-5900, Display-1 is TCP-5901, etc. Additionally, the VNC server will listen for connections from a web-browser on TCP port “5800+N”, where N is as above. If you point a web-browser to this port, the VNC server will automatically provide a Java VNC viewer that runs right in your web-browser. This Java Viewer will then exchange data with the VNC Server on the same ports a normal VNC Viewer would use: “5900+N”. Lastly, if you start a “server-initiated connection” to a Listen-mode Viewer (this is a pretty advanced mode), the connection will be to TCP port “5500+N” on the Viewer.