amitbet / vnc2video

A fully featured VNC client written in golang
MIT License
151 stars 39 forks source link

Authentication failed #20

Open sdaau opened 1 year ago

sdaau commented 1 year ago

I am complete noob in go, but I managed to build an example under 20.04:

cd ~/go/src/github.com/amitbet/vnc2video/example/client
go build

# $ du -s *
# 1784  client
# 4432  debug
# 34756 ffmpeg
# 8 main.go

OK, so - now, I have a remote VNC server, and it works fine with ssvncviewer like this:

ssvncviewer -x11cursor -bgr233 -quality 4 -compresslevel 8 myserver.com::19800
Proto: RFB 003.008

Connected to RFB server, using protocol version 3.8

SelectSecurityType:
  sec-type[0]    2  (rfbSecTypeVncAuth)
  sec-type[1]   16  (rfbSecTypeTight)
Enabling TightVNC protocol extensions
Security-Type:  16  (rfbSecTypeTight)  Latency: 58.19 ms

Performing standard VNC authentication
VNC Password:
VNC authentication succeeded
...

Note ssvncviewer uses double colon :: for direct IP port specification, else single colon is for "VNC display" (i.e. "VNC display": 1 == port 5901 etc).

So, correspondingly I try ./client - where the port in the argument is specified with single colon:

$ ./client myserver.com:19800
[Error] Handshake failed, check that server is running:  Authentication failed from 127.0.0.1
^C

... and I get an error, and the program hangs until I close it with Ctrl-C.

I'm pretty sure it sees at least some sort of a server on the other end, because if I change the port to a non-existing one, program fails with a segfault instead:

$ ./client myserver.com:19801
[Fatal] Error connecting to VNC host. [dial tcp XXX.YYY.ZZZ.WWW:19801: connect: connection refused]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=1 addr=8 pc=139674060690197]

goroutine 1 [running]:
bufio.Reader.Read
    ../../../src/libgo/go/bufio/bufio.go:223
...

Well, not sure if my problem is fixable, even, but I thought I'd report; would've been great if this worked, cannot get any of the old stuff (vncrec, rfbproxy) to work anymore ...