node-rfb2 icon indicating copy to clipboard operation
node-rfb2 copied to clipboard

ultravnc_repeater: short read 10 != 250 throws EPIPE

Open zxfrank opened this issue 8 years ago • 10 comments

While trying to connect to ultravnc repeater, I get the error:

{ [Error: This socket has been ended by the other party] code: 'EPIPE' }

and on the repeater

new vnc client connecting.
ULTRAVNC_REPEATER_NO_RFB: not sending RFB 000.000
ultravnc_repeater: short read 10 != 250

my settings to connect to the repeater are:

{
    "host"    : 'myrepeater.example.com',
     "port"    : '123456',
      "password": '+ID:12345678'
}

Is there a trick to make magic happen or is it just me?

thanks for your help

zxfrank avatar Jul 14 '16 20:07 zxfrank

I haven't used ultravnc repeater before, can you give a short intro on how to setup everything @zxfrank ? Alternatively, if you can provide network dump around disconnect time that would be helpful. Looks like ultravnc does not like something and closes connection

sidorares avatar Jul 14 '16 23:07 sidorares

ultravnc repeater log only the 3 lines. The nodejs app log the error again and again and again freakin fast. It occurs on init.

I have an old version of the repeater, I will try with the latest tomorrow.

the exact string in ssvnc (proxy/Gateway) to connect is:

repeater://hostname:port+ID:_ANY_CHARS

http://www.uvnc.com/downloads/repeater/83-repeater-downloads.html

zxfrank avatar Jul 15 '16 00:07 zxfrank

thanks, I'll try to play with repeater on my side

sidorares avatar Jul 15 '16 00:07 sidorares

Ok now on the latest version of the repeater I got

{ [Error: read ECONNRESET] code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' }
[Error: This socket is closed.]
[Error: This socket is closed.]
[Error: This socket is closed.]
[Error: This socket is closed.]
[Error: This socket is closed.]
[Error: This socket is closed.]
[Error: This socket is closed.]

then on repeater log

UltraVnc Fri Jul 15 08:48:55 2016 > routeConnections(): new server connecting, accepting...
UltraVnc Fri Jul 15 08:48:55 2016 > acceptConnection(): connection accepted ok from ip: 127.0.0.1
UltraVnc Fri Jul 15 08:48:55 2016 > nonBlockingRead(): start
UltraVnc Fri Jul 15 08:48:58 2016 > nonBlockingRead(): returning normally
UltraVnc Fri Jul 15 08:48:58 2016 > checkIdCode():  is not IdCode string
UltraVnc Fri Jul 15 08:48:58 2016 > acceptConnection(): mode 1 connections are not allowed, closing connection

It looks like rfb is trying to connect in standard mode instead of (oh my god I had a flash) proxy.

We need to supply proxy parameters in the connection params! like with ssvnc... Is it implemented? if not, do you have an idea where to start?

thanks

zxfrank avatar Jul 15 '16 12:07 zxfrank

What kind of proxy is that?

sidorares avatar Jul 15 '16 13:07 sidorares

You can pass any duplex stream as a parameter using stream option, see https://github.com/sidorares/node-rfb2/blob/master/rfbclient.js#L617

For socks proxy for example you can use code similar to https://github.com/sidorares/node-mysql2#connecting-using-custom-stream

sidorares avatar Jul 15 '16 13:07 sidorares

UltraVNC Repeater http://www.uvnc.com/products/uvnc-repeater.html

is acts as a gateway, the manager connects to it and client reverse connect so you don't have to open firewall

zxfrank avatar Jul 15 '16 13:07 zxfrank

so from the client point of view repeater acts like a normal vnc server?

sidorares avatar Jul 15 '16 13:07 sidorares

It depends on the mode, I use the mode 2. The repeater is like a gateway, receive connections from both sides and link them together. There's no firewall to configure, it works from anywhere.

zxfrank avatar Jul 15 '16 13:07 zxfrank

Maybe we could get some ideas from noVNC https://github.com/kanaka/noVNC/issues/103

zxfrank avatar Jul 15 '16 13:07 zxfrank