Skip to content

18121861183/go-vnc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VNC Library for Go

go-vnc is a VNC client library for Go.

This library implements RFC 6143 -- The Remote Framebuffer Protocol -- the protocol used by VNC.

Project links

  • Build Status: Build Status
  • Documentation: GoDoc

Setup

  1. Download software and supporting packages.

    $ go get github.com/18121861183/go-vnc
    $ go get golang.org/x/net
    

Usage

Sample code usage is available in the GoDoc.

The source code is laid out such that the files match the document sections:

  • [7.1] handshake.go
  • [7.2] security.go
  • [7.3] initialization.go
  • [7.4] pixel_format.go
  • [7.5] client.go
  • [7.6] server.go
  • [7.7] encodings.go

There are two additional files that provide everything else:

  • vncclient.go -- code for instantiating a VNC client
  • common.go -- common stuff not related to the RFB protocol

Example

nc, err := net.Dial("tcp", "192.168.9.93:5900")
if err != nil {
   log.Fatalf("Error connecting to VNC host. %v", err)
}

// Negotiate connection with the server.
vcc := vnc.NewClientConfig("11111111")
vc, version, err := vnc.Connect(context.Background(), nc, vcc)

print(version)
if err != nil {
   log.Fatalf("Error negotiating connection to VNC host. %v", err)
}
fmt.Println(vc.DesktopName())

About

探测版本

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages