rfb

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package rfb implements the host side of Crabfleet's RFB 3.8 profile.

Index

Constants

View Source
const (
	SecurityVNC = 2
	SecurityARD = 30

	EncodingTight           int32 = 7
	EncodingPointerPosition int32 = -232
	EncodingCursor          int32 = -239
	EncodingCursorWithAlpha int32 = -314

	MaxEncodings       = 256
	MaxDesktopName     = 4096
	MaxSecurityReason  = 4096
	MaxTightJPEGLength = 1 << 22
)

Variables

View Source
var (
	Version38Banner = []byte("RFB 003.008\n")
)

Functions

func EncodeJPEG

func EncodeJPEG(frame connect.Frame, quality int) ([]byte, error)

func ServeConn

func ServeConn(ctx context.Context, connection net.Conn, config SessionConfig) error

func ServerInit

func ServerInit(width, height int, name string) ([]byte, error)

func TightCompactLength

func TightCompactLength(length int) ([]byte, error)

func VNCChallengeResponse

func VNCChallengeResponse(challenge []byte, password string) ([]byte, error)

func VerifyVNCResponse

func VerifyVNCResponse(challenge, response []byte, password string) (bool, error)

Types

type Encodings

type Encodings struct {
	Tight           bool
	CursorWithAlpha bool
	Cursor          bool
	PointerPosition bool
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(config ServerConfig) (*Server, error)

func (*Server) Close

func (server *Server) Close() error

func (*Server) Serve

func (server *Server) Serve(ctx context.Context, listener net.Listener) error

type ServerConfig

type ServerConfig struct {
	Session     SessionConfig
	MaxSessions int
}

type SessionConfig

type SessionConfig struct {
	Backend          connect.Backend
	Password         string
	DesktopName      string
	ChallengeReader  io.Reader
	HandshakeTimeout time.Duration
	MediaTimeout     time.Duration
	JPEGQuality      int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL