vncproxy

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InfoFlag  uint32 = 0x1 << 0
	DebugFlag uint32 = 0x1 << 1

	InfoLevel  uint32 = InfoFlag
	DebugLevel uint32 = InfoFlag | DebugFlag
)

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(level uint32, instance Logger) *logger

func NewPeer

func NewPeer(ws *websocket.Conn, addr string, dialTimeout time.Duration) (*peer, error)

Types

type Config

type Config struct {
	LogLevel    uint32
	Logger      Logger
	DialTimeout time.Duration
	TokenHandler
}

Config represents vnc proxy config

type Logger

type Logger interface {
	Infof(format string, v ...interface{})
	Debugf(format string, v ...interface{})
}

type Proxy

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

Proxy represents vnc proxy

func New

func New(conf *Config) *Proxy

New returns a vnc proxy If token handler is nil, vnc backend address will always be :5901

func (*Proxy) Peers

func (p *Proxy) Peers() map[*peer]struct{}

func (*Proxy) ServeWS

func (p *Proxy) ServeWS(ws *websocket.Conn)

ServeWS provides websocket handler

type TokenHandler

type TokenHandler func(r *http.Request) (addr string, err error)

Jump to

Keyboard shortcuts

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