Documentation ¶
Index ¶
- Constants
- Variables
- func AuthVNCEncode(password []byte, challenge []byte) ([]byte, error)
- func CalcBytesPerCPixel(pf *PixelFormat) int
- func DecodeRaw(reader io.Reader, pf *PixelFormat, rect *Rectangle, targetImage draw.Image) error
- func DrawImage(target draw.Image, imageToApply image.Image, pos image.Point)
- func FillRect(img draw.Image, rect *image.Rectangle, c color.Color)
- func IsCPixelSpecific(pf *PixelFormat) bool
- func MakeRect(x, y, width, height int) image.Rectangle
- func MakeRectFromVncRect(rect *Rectangle) image.Rectangle
- func Mask(button Button) uint8
- func Min(a, b int) int
- func ParseProtoVersion(pv []byte) (uint, uint, error)
- func ReadBytes(count int, r io.Reader) ([]byte, error)
- func ReadColor(c io.Reader, pf *PixelFormat) (*color.RGBA, error)
- func ReadUint16(r io.Reader) (uint16, error)
- func ReadUint32(r io.Reader) (uint32, error)
- func ReadUint8(r io.Reader) (uint8, error)
- func Serve(ctx context.Context, ln net.Listener, cfg *ServerConfig) error
- type AtenHermon
- type AtenHermonSubrect
- type AteniKVMFrontGroundEvent
- type AteniKVMGetViewerLang
- type AteniKVMKeepAliveEvent
- type AteniKVMKeyEvent
- type AteniKVMMouseGetInfo
- type AteniKVMPointerEvent
- type AteniKVMSessionMessage
- type AteniKVMVideoGetInfo
- type Bell
- type Button
- type ClientAuthATEN
- type ClientAuthNone
- type ClientAuthUltraMsAutoLogon2
- type ClientAuthVNC
- type ClientAuthVeNCrypt02Plain
- type ClientConfig
- type ClientConn
- func (c *ClientConn) Close() error
- func (c *ClientConn) ColorMap() ColorMap
- func (c *ClientConn) Config() interface{}
- func (c *ClientConn) Conn() net.Conn
- func (c *ClientConn) DesktopName() []byte
- func (c *ClientConn) Encodings() []Encoding
- func (c *ClientConn) Flush() error
- func (c *ClientConn) GetEncInstance(typ EncodingType) Encoding
- func (c *ClientConn) Height() uint16
- func (c *ClientConn) PixelFormat() PixelFormat
- func (c *ClientConn) Protocol() string
- func (c *ClientConn) Read(buf []byte) (int, error)
- func (cc *ClientConn) ResetAllEncodings()
- func (c *ClientConn) SecurityHandler() SecurityHandler
- func (c *ClientConn) SetColorMap(cm ColorMap)
- func (c *ClientConn) SetDesktopName(name []byte)
- func (c *ClientConn) SetEncodings(encs []EncodingType) error
- func (c *ClientConn) SetHeight(height uint16)
- func (c *ClientConn) SetPixelFormat(pf PixelFormat) error
- func (c *ClientConn) SetProtoVersion(pv string)
- func (c *ClientConn) SetSecurityHandler(sechandler SecurityHandler) error
- func (c *ClientConn) SetWidth(width uint16)
- func (c *ClientConn) Wait()
- func (c *ClientConn) Width() uint16
- func (c *ClientConn) Write(buf []byte) (int, error)
- type ClientCutText
- type ClientMessage
- type ClientMessageType
- type CoRREEncoding
- type Color
- type ColorMap
- type Conn
- type CopyRectEncoding
- func (enc *CopyRectEncoding) Read(c Conn, rect *Rectangle) error
- func (*CopyRectEncoding) Reset() error
- func (enc *CopyRectEncoding) SetTargetImage(img draw.Image)
- func (*CopyRectEncoding) Supported(Conn) bool
- func (*CopyRectEncoding) Type() EncodingType
- func (enc *CopyRectEncoding) Write(c Conn, rect *Rectangle) error
- type CursorPosPseudoEncoding
- func (enc *CursorPosPseudoEncoding) Read(c Conn, rect *Rectangle) error
- func (enc *CursorPosPseudoEncoding) Reset() error
- func (enc *CursorPosPseudoEncoding) SetTargetImage(img draw.Image)
- func (*CursorPosPseudoEncoding) Supported(Conn) bool
- func (*CursorPosPseudoEncoding) Type() EncodingType
- func (enc *CursorPosPseudoEncoding) Write(c Conn, rect *Rectangle) error
- type CursorPseudoEncoding
- func (enc *CursorPseudoEncoding) Read(c Conn, rect *Rectangle) error
- func (enc *CursorPseudoEncoding) Reset() error
- func (enc *CursorPseudoEncoding) SetTargetImage(img draw.Image)
- func (*CursorPseudoEncoding) Supported(Conn) bool
- func (*CursorPseudoEncoding) Type() EncodingType
- func (enc *CursorPseudoEncoding) Write(c Conn, rect *Rectangle) error
- type DefaultClientClientInitHandler
- type DefaultClientMessageHandler
- type DefaultClientSecurityHandler
- type DefaultClientServerInitHandler
- type DefaultClientVersionHandler
- type DefaultServerClientInitHandler
- type DefaultServerMessageHandler
- type DefaultServerSecurityHandler
- type DefaultServerServerInitHandler
- type DefaultServerVersionHandler
- type DesktopNamePseudoEncoding
- func (enc *DesktopNamePseudoEncoding) Read(c Conn, rect *Rectangle) error
- func (*DesktopNamePseudoEncoding) Reset() error
- func (*DesktopNamePseudoEncoding) Supported(Conn) bool
- func (*DesktopNamePseudoEncoding) Type() EncodingType
- func (enc *DesktopNamePseudoEncoding) Write(c Conn, rect *Rectangle) error
- type DesktopSizePseudoEncoding
- func (*DesktopSizePseudoEncoding) Read(c Conn, rect *Rectangle) error
- func (*DesktopSizePseudoEncoding) Reset() error
- func (*DesktopSizePseudoEncoding) Supported(Conn) bool
- func (*DesktopSizePseudoEncoding) Type() EncodingType
- func (enc *DesktopSizePseudoEncoding) Write(c Conn, rect *Rectangle) error
- type Encoding
- type EncodingType
- type FBSPlayHelper
- type FbsConn
- func (c *FbsConn) ColorMap() ColorMap
- func (c *FbsConn) Config() interface{}
- func (c *FbsConn) Conn() net.Conn
- func (c *FbsConn) DesktopName() []byte
- func (c *FbsConn) Encodings() []Encoding
- func (c *FbsConn) Flush() error
- func (c *FbsConn) GetEncInstance(typ EncodingType) Encoding
- func (c *FbsConn) Height() uint16
- func (c *FbsConn) PixelFormat() PixelFormat
- func (c *FbsConn) Protocol() string
- func (c *FbsConn) SecurityHandler() SecurityHandler
- func (c *FbsConn) SetColorMap(cm ColorMap)
- func (c *FbsConn) SetDesktopName(d []byte)
- func (c *FbsConn) SetEncodings([]EncodingType) error
- func (c *FbsConn) SetHeight(h uint16)
- func (c *FbsConn) SetPixelFormat(pf PixelFormat) error
- func (c *FbsConn) SetProtoVersion(string)
- func (c *FbsConn) SetSecurityHandler(SecurityHandler) error
- func (c *FbsConn) SetWidth(w uint16)
- func (c *FbsConn) Wait()
- func (c *FbsConn) Width() uint16
- func (c *FbsConn) Write(buf []byte) (int, error)
- type FbsReader
- type FbsSegment
- type FramebufferUpdate
- type FramebufferUpdateRequest
- type Handler
- type HextileEncoding
- func (z *HextileEncoding) Read(r Conn, rect *Rectangle) error
- func (enc *HextileEncoding) Reset() error
- func (enc *HextileEncoding) SetTargetImage(img draw.Image)
- func (*HextileEncoding) Supported(Conn) bool
- func (z *HextileEncoding) Type() EncodingType
- func (enc *HextileEncoding) Write(c Conn, rect *Rectangle) error
- func (z *HextileEncoding) WriteTo(w io.Writer) (n int, err error)
- type Key
- type KeyEvent
- type Keys
- type PixelFormat
- type PointerEvent
- type RGBColor
- type RGBImage
- func (p *RGBImage) At(x, y int) color.Color
- func (p *RGBImage) Bounds() image.Rectangle
- func (p *RGBImage) ColorModel() color.Model
- func (p *RGBImage) Opaque() bool
- func (p *RGBImage) PixOffset(x, y int) int
- func (p *RGBImage) RGBAt(x, y int) *RGBColor
- func (p *RGBImage) Set(x, y int, c color.Color)
- func (p *RGBImage) SetRGB(x, y int, c color.RGBA)
- func (p *RGBImage) SubImage(r image.Rectangle) image.Image
- type RREEncoding
- func (enc *RREEncoding) Read(r Conn, rect *Rectangle) error
- func (enc *RREEncoding) Reset() error
- func (enc *RREEncoding) SetTargetImage(img draw.Image)
- func (*RREEncoding) Supported(Conn) bool
- func (*RREEncoding) Type() EncodingType
- func (enc *RREEncoding) Write(c Conn, rect *Rectangle) error
- func (z *RREEncoding) WriteTo(w io.Writer) (n int, err error)
- type RawEncoding
- type Rectangle
- type Renderer
- type SecurityHandler
- type SecuritySubType
- type SecurityType
- type ServerAuthNone
- type ServerAuthVNC
- type ServerConfig
- type ServerConn
- func (c *ServerConn) Close() error
- func (c *ServerConn) ColorMap() ColorMap
- func (c *ServerConn) Config() interface{}
- func (c *ServerConn) Conn() net.Conn
- func (c *ServerConn) DesktopName() []byte
- func (c *ServerConn) Encodings() []Encoding
- func (c *ServerConn) Flush() error
- func (c *ServerConn) GetEncInstance(typ EncodingType) Encoding
- func (c *ServerConn) Height() uint16
- func (c *ServerConn) PixelFormat() PixelFormat
- func (c *ServerConn) Protocol() string
- func (c *ServerConn) Read(buf []byte) (int, error)
- func (c *ServerConn) SecurityHandler() SecurityHandler
- func (c *ServerConn) SetColorMap(cm ColorMap)
- func (c *ServerConn) SetDesktopName(name []byte)
- func (c *ServerConn) SetEncodings(encs []EncodingType) error
- func (c *ServerConn) SetHeight(h uint16)
- func (c *ServerConn) SetPixelFormat(pf PixelFormat) error
- func (c *ServerConn) SetProtoVersion(pv string)
- func (c *ServerConn) SetSecurityHandler(sechandler SecurityHandler) error
- func (c *ServerConn) SetWidth(w uint16)
- func (c *ServerConn) Wait()
- func (c *ServerConn) Width() uint16
- func (c *ServerConn) Write(buf []byte) (int, error)
- type ServerCutText
- type ServerInit
- type ServerMessage
- type ServerMessageType
- type SetColorMapEntries
- type SetEncodings
- type SetPixelFormat
- type TightCC
- type TightCompression
- type TightEncoding
- func (*TightEncoding) GetInstance() *TightEncoding
- func (enc *TightEncoding) Read(c Conn, rect *Rectangle) error
- func (enc *TightEncoding) ReadTightData(dataSize int, c Conn, decoderId int) ([]byte, error)
- func (enc *TightEncoding) Reset() error
- func (enc *TightEncoding) SetTargetImage(img draw.Image)
- func (*TightEncoding) Supported(Conn) bool
- func (*TightEncoding) Type() EncodingType
- func (enc *TightEncoding) Write(c Conn, rect *Rectangle) error
- type TightFilter
- type TightPixel
- type TightPngEncoding
- func (enc *TightPngEncoding) Read(c Conn, rect *Rectangle) error
- func (*TightPngEncoding) Reset() error
- func (enc *TightPngEncoding) SetTargetImage(img draw.Image)
- func (*TightPngEncoding) Supported(Conn) bool
- func (*TightPngEncoding) Type() EncodingType
- func (enc *TightPngEncoding) Write(c Conn, rect *Rectangle) error
- type VncCanvas
- type VncStreamFileReader
- type XCursorPseudoEncoding
- type ZLibEncoding
- func (enc *ZLibEncoding) Read(r Conn, rect *Rectangle) error
- func (enc *ZLibEncoding) Reset() error
- func (enc *ZLibEncoding) SetTargetImage(img draw.Image)
- func (*ZLibEncoding) Supported(Conn) bool
- func (*ZLibEncoding) Type() EncodingType
- func (enc *ZLibEncoding) Write(c Conn, rect *Rectangle) error
- func (enc *ZLibEncoding) WriteTo(w io.Writer) (n int, err error)
- type ZRLEEncoding
- func (enc *ZRLEEncoding) Read(r Conn, rect *Rectangle) error
- func (enc *ZRLEEncoding) Reset() error
- func (enc *ZRLEEncoding) SetTargetImage(img draw.Image)
- func (*ZRLEEncoding) Supported(Conn) bool
- func (*ZRLEEncoding) Type() EncodingType
- func (enc *ZRLEEncoding) Write(c Conn, rect *Rectangle) error
- func (z *ZRLEEncoding) WriteTo(w io.Writer) (n int, err error)
Constants ¶
const ( HextileRaw = 1 HextileBackgroundSpecified = 2 HextileForegroundSpecified = 4 HextileAnySubrects = 8 HextileSubrectsColoured = 16 )
const ( TightCompressionBasic = 0 TightCompressionFill = 8 TightCompressionJPEG = 9 TightCompressionPNG = 10 )
const ( TightFilterCopy = 0 TightFilterPalette = 1 TightFilterGradient = 2 )
const ( BlockWidth = 16 BlockHeight = 16 )
const ( // ProtoVersionUnknown unknown version ProtoVersionUnknown = "" // ProtoVersion33 sets if proto 003.003 ProtoVersion33 = "RFB 003.003\n" // ProtoVersion38 sets if proto 003.008 ProtoVersion38 = "RFB 003.008\n" // ProtoVersion37 sets if proto 003.007 ProtoVersion37 = "RFB 003.007\n" )
const ProtoVersionLength = 12
ProtoVersionLength protocol version length
Variables ¶
var ( // DefaultClientMessages slice of default client messages sent to server DefaultClientMessages = []ClientMessage{ &SetPixelFormat{}, &SetEncodings{}, &FramebufferUpdateRequest{}, &KeyEvent{}, &PointerEvent{}, &ClientCutText{}, } // DefaultServerMessages slice of default server messages sent to client DefaultServerMessages = []ServerMessage{ &FramebufferUpdate{}, &SetColorMapEntries{}, &Bell{}, &ServerCutText{}, } )
var ( // PixelFormat8bit returns 8 bit pixel format PixelFormat8bit = NewPixelFormat(8) // PixelFormat16bit returns 16 bit pixel format PixelFormat16bit = NewPixelFormat(16) // PixelFormat32bit returns 32 bit pixel format PixelFormat32bit = NewPixelFormat(32) // PixelFormatAten returns pixel format used in Aten IKVM PixelFormatAten = NewPixelFormatAten() )
var ( // DefaultClientHandlers represents default client handlers DefaultClientHandlers = []Handler{ &DefaultClientVersionHandler{}, &DefaultClientSecurityHandler{}, &DefaultClientClientInitHandler{}, &DefaultClientServerInitHandler{}, &DefaultClientMessageHandler{}, } )
var ( // DefaultServerHandlers uses default handlers for hanshake DefaultServerHandlers = []Handler{ &DefaultServerVersionHandler{}, &DefaultServerSecurityHandler{}, &DefaultServerClientInitHandler{}, &DefaultServerServerInitHandler{}, &DefaultServerMessageHandler{}, } )
var TightMinToCompress int = 12
Functions ¶
func CalcBytesPerCPixel ¶
func CalcBytesPerCPixel(pf *PixelFormat) int
func IsCPixelSpecific ¶
func IsCPixelSpecific(pf *PixelFormat) bool
func MakeRectFromVncRect ¶
func ParseProtoVersion ¶
ParseProtoVersion parse protocol version
Types ¶
type AtenHermon ¶
type AtenHermon struct { AtenLength uint32 AtenType uint8 AtenSubrects uint32 AtenRawLength uint32 Encodings []Encoding // contains filtered or unexported fields }
func (*AtenHermon) Reset ¶
func (*AtenHermon) Reset() error
func (*AtenHermon) Supported ¶
func (*AtenHermon) Supported(Conn) bool
func (*AtenHermon) Type ¶
func (*AtenHermon) Type() EncodingType
type AtenHermonSubrect ¶
func (*AtenHermonSubrect) Reset ¶
func (*AtenHermonSubrect) Reset() error
func (*AtenHermonSubrect) Supported ¶
func (*AtenHermonSubrect) Supported(Conn) bool
func (*AtenHermonSubrect) Type ¶
func (enc *AtenHermonSubrect) Type() EncodingType
type AteniKVMFrontGroundEvent ¶
type AteniKVMFrontGroundEvent struct {
// contains filtered or unexported fields
}
AteniKVMFrontGroundEvent unknown aten ikvm message
func (*AteniKVMFrontGroundEvent) Read ¶
func (*AteniKVMFrontGroundEvent) Read(c Conn) (ServerMessage, error)
Read unmarshal message from conn
func (*AteniKVMFrontGroundEvent) String ¶
func (msg *AteniKVMFrontGroundEvent) String() string
String return string representation
func (*AteniKVMFrontGroundEvent) Supported ¶
func (msg *AteniKVMFrontGroundEvent) Supported(c Conn) bool
func (*AteniKVMFrontGroundEvent) Type ¶
func (*AteniKVMFrontGroundEvent) Type() ServerMessageType
Type return ServerMessageType
func (*AteniKVMFrontGroundEvent) Write ¶
func (msg *AteniKVMFrontGroundEvent) Write(c Conn) error
Write marshal message to conn
type AteniKVMGetViewerLang ¶
type AteniKVMGetViewerLang struct {
// contains filtered or unexported fields
}
AteniKVMGetViewerLang unknown aten ikvm message
func (*AteniKVMGetViewerLang) Read ¶
func (*AteniKVMGetViewerLang) Read(c Conn) (ServerMessage, error)
Read unmarshal message from conn
func (*AteniKVMGetViewerLang) String ¶
func (msg *AteniKVMGetViewerLang) String() string
String return string representation
func (*AteniKVMGetViewerLang) Supported ¶
func (msg *AteniKVMGetViewerLang) Supported(c Conn) bool
func (*AteniKVMGetViewerLang) Type ¶
func (*AteniKVMGetViewerLang) Type() ServerMessageType
Type return ServerMessageType
func (*AteniKVMGetViewerLang) Write ¶
func (msg *AteniKVMGetViewerLang) Write(c Conn) error
Write marshal message to conn
type AteniKVMKeepAliveEvent ¶
type AteniKVMKeepAliveEvent struct {
// contains filtered or unexported fields
}
AteniKVMKeepAliveEvent unknown aten ikvm message
func (*AteniKVMKeepAliveEvent) Read ¶
func (*AteniKVMKeepAliveEvent) Read(c Conn) (ServerMessage, error)
Read unmarshal message from conn
func (*AteniKVMKeepAliveEvent) String ¶
func (msg *AteniKVMKeepAliveEvent) String() string
String return string representation
func (*AteniKVMKeepAliveEvent) Supported ¶
func (msg *AteniKVMKeepAliveEvent) Supported(c Conn) bool
func (*AteniKVMKeepAliveEvent) Type ¶
func (*AteniKVMKeepAliveEvent) Type() ServerMessageType
Type return ServerMessageType
func (*AteniKVMKeepAliveEvent) Write ¶
func (msg *AteniKVMKeepAliveEvent) Write(c Conn) error
Write marshal message to conn
type AteniKVMKeyEvent ¶
type AteniKVMKeyEvent struct { Down uint8 // down-flag Key Key // key // contains filtered or unexported fields }
AteniKVMKeyEvent holds the wire format message
func (*AteniKVMKeyEvent) Read ¶
func (*AteniKVMKeyEvent) Read(c Conn) (ClientMessage, error)
func (*AteniKVMKeyEvent) String ¶
func (msg *AteniKVMKeyEvent) String() string
func (*AteniKVMKeyEvent) Supported ¶
func (msg *AteniKVMKeyEvent) Supported(c Conn) bool
func (*AteniKVMKeyEvent) Type ¶
func (msg *AteniKVMKeyEvent) Type() ClientMessageType
func (*AteniKVMKeyEvent) Write ¶
func (msg *AteniKVMKeyEvent) Write(c Conn) error
type AteniKVMMouseGetInfo ¶
type AteniKVMMouseGetInfo struct {
// contains filtered or unexported fields
}
AteniKVMMouseGetInfo unknown aten ikvm message
func (*AteniKVMMouseGetInfo) Read ¶
func (*AteniKVMMouseGetInfo) Read(c Conn) (ServerMessage, error)
Read unmarshal message from conn
func (*AteniKVMMouseGetInfo) String ¶
func (msg *AteniKVMMouseGetInfo) String() string
String return string representation
func (*AteniKVMMouseGetInfo) Supported ¶
func (msg *AteniKVMMouseGetInfo) Supported(c Conn) bool
func (*AteniKVMMouseGetInfo) Type ¶
func (*AteniKVMMouseGetInfo) Type() ServerMessageType
Type return ServerMessageType
func (*AteniKVMMouseGetInfo) Write ¶
func (msg *AteniKVMMouseGetInfo) Write(c Conn) error
Write marshal message to conn
type AteniKVMPointerEvent ¶
type AteniKVMPointerEvent struct { Mask uint8 // mask X uint16 // x Y uint16 // y // contains filtered or unexported fields }
AteniKVMPointerEvent holds the wire format message
func (*AteniKVMPointerEvent) Read ¶
func (*AteniKVMPointerEvent) Read(c Conn) (ClientMessage, error)
func (*AteniKVMPointerEvent) String ¶
func (msg *AteniKVMPointerEvent) String() string
func (*AteniKVMPointerEvent) Supported ¶
func (msg *AteniKVMPointerEvent) Supported(c Conn) bool
func (*AteniKVMPointerEvent) Type ¶
func (msg *AteniKVMPointerEvent) Type() ClientMessageType
func (*AteniKVMPointerEvent) Write ¶
func (msg *AteniKVMPointerEvent) Write(c Conn) error
type AteniKVMSessionMessage ¶
type AteniKVMSessionMessage struct {
// contains filtered or unexported fields
}
AteniKVMSessionMessage unknown aten ikvm message
func (*AteniKVMSessionMessage) Read ¶
func (*AteniKVMSessionMessage) Read(c Conn) (ServerMessage, error)
Read unmarshal message from conn
func (*AteniKVMSessionMessage) String ¶
func (msg *AteniKVMSessionMessage) String() string
String return string representation
func (*AteniKVMSessionMessage) Supported ¶
func (msg *AteniKVMSessionMessage) Supported(c Conn) bool
func (*AteniKVMSessionMessage) Type ¶
func (*AteniKVMSessionMessage) Type() ServerMessageType
Type return ServerMessageType
func (*AteniKVMSessionMessage) Write ¶
func (msg *AteniKVMSessionMessage) Write(c Conn) error
Write marshal message to conn
type AteniKVMVideoGetInfo ¶
type AteniKVMVideoGetInfo struct {
// contains filtered or unexported fields
}
AteniKVMVideoGetInfo unknown aten ikvm message
func (*AteniKVMVideoGetInfo) Read ¶
func (*AteniKVMVideoGetInfo) Read(c Conn) (ServerMessage, error)
Read unmarshal message from conn
func (*AteniKVMVideoGetInfo) String ¶
func (msg *AteniKVMVideoGetInfo) String() string
String return string representation
func (*AteniKVMVideoGetInfo) Supported ¶
func (msg *AteniKVMVideoGetInfo) Supported(c Conn) bool
func (*AteniKVMVideoGetInfo) Type ¶
func (*AteniKVMVideoGetInfo) Type() ServerMessageType
Type return ServerMessageType
func (*AteniKVMVideoGetInfo) Write ¶
func (msg *AteniKVMVideoGetInfo) Write(c Conn) error
Write marshal message to conn
type Bell ¶
type Bell struct{}
Bell server message
type Button ¶
type Button uint8
Button represents a mask of pointer presses/releases.
type ClientAuthATEN ¶
func (*ClientAuthATEN) Auth ¶
func (auth *ClientAuthATEN) Auth(c Conn) error
func (*ClientAuthATEN) SubType ¶
func (*ClientAuthATEN) SubType() SecuritySubType
func (*ClientAuthATEN) Type ¶
func (*ClientAuthATEN) Type() SecurityType
type ClientAuthNone ¶
type ClientAuthNone struct{}
func (*ClientAuthNone) Auth ¶
func (*ClientAuthNone) Auth(conn Conn) error
func (*ClientAuthNone) SubType ¶
func (*ClientAuthNone) SubType() SecuritySubType
func (*ClientAuthNone) Type ¶
func (*ClientAuthNone) Type() SecurityType
type ClientAuthUltraMsAutoLogon2 ¶
ClientAuthUltraMsAutoLogon2 is implemented by Ultra VNC when using the MS-Logon II authentication. see http://www.uvnc.com/features/authentication.html
func (*ClientAuthUltraMsAutoLogon2) Auth ¶
func (auth *ClientAuthUltraMsAutoLogon2) Auth(c Conn) error
func (*ClientAuthUltraMsAutoLogon2) SubType ¶
func (*ClientAuthUltraMsAutoLogon2) SubType() SecuritySubType
func (*ClientAuthUltraMsAutoLogon2) Type ¶
func (*ClientAuthUltraMsAutoLogon2) Type() SecurityType
type ClientAuthVNC ¶
ClientAuthVNC is the standard password authentication. See 7.2.2.
func (*ClientAuthVNC) Auth ¶
func (auth *ClientAuthVNC) Auth(c Conn) error
func (*ClientAuthVNC) SubType ¶
func (*ClientAuthVNC) SubType() SecuritySubType
func (*ClientAuthVNC) Type ¶
func (*ClientAuthVNC) Type() SecurityType
type ClientAuthVeNCrypt02Plain ¶
ClientAuthVeNCryptPlain see https://www.berrange.com/~dan/vencrypt.txt
func (*ClientAuthVeNCrypt02Plain) Auth ¶
func (auth *ClientAuthVeNCrypt02Plain) Auth(c Conn) error
func (*ClientAuthVeNCrypt02Plain) SubType ¶
func (*ClientAuthVeNCrypt02Plain) SubType() SecuritySubType
func (*ClientAuthVeNCrypt02Plain) Type ¶
func (*ClientAuthVeNCrypt02Plain) Type() SecurityType
type ClientConfig ¶
type ClientConfig struct { Handlers []Handler SecurityHandlers []SecurityHandler Encodings []Encoding PixelFormat PixelFormat ColorMap ColorMap ClientMessageCh chan ClientMessage ServerMessageCh chan ServerMessage Exclusive bool DrawCursor bool Messages []ServerMessage QuitCh chan struct{} ErrorCh chan error // contains filtered or unexported fields }
A ClientConfig structure is used to configure a ClientConn. After one has been passed to initialize a connection, it must not be modified.
type ClientConn ¶
type ClientConn struct { Canvas *VncCanvas // contains filtered or unexported fields }
The ClientConn type holds client connection information
func Connect ¶
func Connect(ctx context.Context, c net.Conn, cfg *ClientConfig) (*ClientConn, error)
Connect handshake with remote server using underlining net.Conn
func NewClientConn ¶
func NewClientConn(c net.Conn, cfg *ClientConfig) (*ClientConn, error)
NewClientConn creates new client conn using config
func (*ClientConn) Config ¶
func (c *ClientConn) Config() interface{}
Config returns connection config
func (*ClientConn) DesktopName ¶
func (c *ClientConn) DesktopName() []byte
DesktopName returns connection desktop name
func (*ClientConn) Encodings ¶
func (c *ClientConn) Encodings() []Encoding
Encodings returns client encodings
func (*ClientConn) GetEncInstance ¶
func (c *ClientConn) GetEncInstance(typ EncodingType) Encoding
func (*ClientConn) PixelFormat ¶
func (c *ClientConn) PixelFormat() PixelFormat
PixelFormat returns connection pixel format
func (*ClientConn) Read ¶
func (c *ClientConn) Read(buf []byte) (int, error)
Read reads data from conn
func (*ClientConn) ResetAllEncodings ¶
func (cc *ClientConn) ResetAllEncodings()
func (*ClientConn) SecurityHandler ¶
func (c *ClientConn) SecurityHandler() SecurityHandler
SecurityHandler returns security handler
func (*ClientConn) SetColorMap ¶
func (c *ClientConn) SetColorMap(cm ColorMap)
SetColorMap sets color map
func (*ClientConn) SetDesktopName ¶
func (c *ClientConn) SetDesktopName(name []byte)
SetDesktopName sets desktop name
func (*ClientConn) SetEncodings ¶
func (c *ClientConn) SetEncodings(encs []EncodingType) error
SetEncodings write SetEncodings message
func (*ClientConn) SetHeight ¶
func (c *ClientConn) SetHeight(height uint16)
SetHeight sets height of client conn
func (*ClientConn) SetPixelFormat ¶
func (c *ClientConn) SetPixelFormat(pf PixelFormat) error
SetPixelFormat sets pixel format
func (*ClientConn) SetProtoVersion ¶
func (c *ClientConn) SetProtoVersion(pv string)
SetProtoVersion sets proto version
func (*ClientConn) SetSecurityHandler ¶
func (c *ClientConn) SetSecurityHandler(sechandler SecurityHandler) error
SetSecurityHandler sets security handler
func (*ClientConn) SetWidth ¶
func (c *ClientConn) SetWidth(width uint16)
SetWidth sets width of client conn
type ClientCutText ¶
type ClientCutText struct { Length uint32 // length Text []byte // contains filtered or unexported fields }
ClientCutText holds the wire format message, sans the text field.
func (*ClientCutText) Read ¶
func (*ClientCutText) Read(c Conn) (ClientMessage, error)
Read unmarshal message from conn
func (*ClientCutText) Supported ¶
func (msg *ClientCutText) Supported(c Conn) bool
func (*ClientCutText) Type ¶
func (*ClientCutText) Type() ClientMessageType
Type returns MessageType
func (*ClientCutText) Write ¶
func (msg *ClientCutText) Write(c Conn) error
Write marshal message to conn
type ClientMessage ¶
type ClientMessage interface { String() string Type() ClientMessageType Read(Conn) (ClientMessage, error) Write(Conn) error Supported(Conn) bool }
type ClientMessageType ¶
type ClientMessageType uint8
ClientMessageType represents RFB message type
const ( SetPixelFormatMsgType ClientMessageType = iota SetEncodingsMsgType FramebufferUpdateRequestMsgType KeyEventMsgType PointerEventMsgType ClientCutTextMsgType )
Client-to-Server message types.
const ( AteniKVMKeyEventMsgType ClientMessageType = 4 AteniKVMPointerEventMsgType ClientMessageType = 5 )
Aten IKVM client message types
func (ClientMessageType) String ¶
func (i ClientMessageType) String() string
type CoRREEncoding ¶
type CoRREEncoding struct {
// contains filtered or unexported fields
}
func (*CoRREEncoding) Type ¶
func (z *CoRREEncoding) Type() int32
type Color ¶
type Color struct {
R, G, B uint16
// contains filtered or unexported fields
}
Color represents a single color in a color map.
func NewColor ¶
func NewColor(pf *PixelFormat, cm *ColorMap) *Color
NewColor returns a new Color object
type Conn ¶
type Conn interface { io.ReadWriteCloser Conn() net.Conn Config() interface{} Protocol() string PixelFormat() PixelFormat SetPixelFormat(PixelFormat) error ColorMap() ColorMap SetColorMap(ColorMap) Encodings() []Encoding SetEncodings([]EncodingType) error Width() uint16 Height() uint16 SetWidth(uint16) SetHeight(uint16) DesktopName() []byte SetDesktopName([]byte) Flush() error Wait() SetProtoVersion(string) SetSecurityHandler(SecurityHandler) error SecurityHandler() SecurityHandler GetEncInstance(EncodingType) Encoding }
Conn represents vnc conection
type CopyRectEncoding ¶
func (*CopyRectEncoding) Reset ¶
func (*CopyRectEncoding) Reset() error
func (*CopyRectEncoding) SetTargetImage ¶
func (enc *CopyRectEncoding) SetTargetImage(img draw.Image)
func (*CopyRectEncoding) Supported ¶
func (*CopyRectEncoding) Supported(Conn) bool
func (*CopyRectEncoding) Type ¶
func (*CopyRectEncoding) Type() EncodingType
type CursorPosPseudoEncoding ¶
func (*CursorPosPseudoEncoding) Read ¶
func (enc *CursorPosPseudoEncoding) Read(c Conn, rect *Rectangle) error
func (*CursorPosPseudoEncoding) Reset ¶
func (enc *CursorPosPseudoEncoding) Reset() error
func (*CursorPosPseudoEncoding) SetTargetImage ¶
func (enc *CursorPosPseudoEncoding) SetTargetImage(img draw.Image)
func (*CursorPosPseudoEncoding) Supported ¶
func (*CursorPosPseudoEncoding) Supported(Conn) bool
func (*CursorPosPseudoEncoding) Type ¶
func (*CursorPosPseudoEncoding) Type() EncodingType
type CursorPseudoEncoding ¶
func (*CursorPseudoEncoding) Read ¶
func (enc *CursorPseudoEncoding) Read(c Conn, rect *Rectangle) error
func (*CursorPseudoEncoding) Reset ¶
func (enc *CursorPseudoEncoding) Reset() error
func (*CursorPseudoEncoding) SetTargetImage ¶
func (enc *CursorPseudoEncoding) SetTargetImage(img draw.Image)
func (*CursorPseudoEncoding) Supported ¶
func (*CursorPseudoEncoding) Supported(Conn) bool
func (*CursorPseudoEncoding) Type ¶
func (*CursorPseudoEncoding) Type() EncodingType
type DefaultClientClientInitHandler ¶
type DefaultClientClientInitHandler struct{}
DefaultClientClientInitHandler default client client init handler
func (*DefaultClientClientInitHandler) Handle ¶
func (*DefaultClientClientInitHandler) Handle(c Conn) error
Handle provide default client client init handler
type DefaultClientMessageHandler ¶
type DefaultClientMessageHandler struct{}
DefaultClientMessageHandler represents default client message handler
func (*DefaultClientMessageHandler) Handle ¶
func (*DefaultClientMessageHandler) Handle(c Conn) error
Handle handles server messages.
type DefaultClientSecurityHandler ¶
type DefaultClientSecurityHandler struct{}
DefaultClientSecurityHandler used for client security handler
func (*DefaultClientSecurityHandler) Handle ¶
func (*DefaultClientSecurityHandler) Handle(c Conn) error
Handle provide client side security handler
type DefaultClientServerInitHandler ¶
type DefaultClientServerInitHandler struct{}
DefaultClientServerInitHandler default client server init handler
func (*DefaultClientServerInitHandler) Handle ¶
func (*DefaultClientServerInitHandler) Handle(c Conn) error
Handle provide default server init handler
type DefaultClientVersionHandler ¶
type DefaultClientVersionHandler struct{}
DefaultClientVersionHandler represents default handler
func (*DefaultClientVersionHandler) Handle ¶
func (*DefaultClientVersionHandler) Handle(c Conn) error
Handle provide version handler for client side
type DefaultServerClientInitHandler ¶
type DefaultServerClientInitHandler struct{}
DefaultServerClientInitHandler default server client init handler
func (*DefaultServerClientInitHandler) Handle ¶
func (*DefaultServerClientInitHandler) Handle(c Conn) error
Handle provide default server client init handler
type DefaultServerMessageHandler ¶
type DefaultServerMessageHandler struct{}
DefaultServerMessageHandler default package handler
func (*DefaultServerMessageHandler) Handle ¶
func (*DefaultServerMessageHandler) Handle(c Conn) error
Handle handles messages from clients
type DefaultServerSecurityHandler ¶
type DefaultServerSecurityHandler struct{}
DefaultServerSecurityHandler used for server security handler
func (*DefaultServerSecurityHandler) Handle ¶
func (*DefaultServerSecurityHandler) Handle(c Conn) error
Handle provide server side security handler
type DefaultServerServerInitHandler ¶
type DefaultServerServerInitHandler struct{}
DefaultServerServerInitHandler default server server init handler
func (*DefaultServerServerInitHandler) Handle ¶
func (*DefaultServerServerInitHandler) Handle(c Conn) error
Handle provide default server server init handler
type DefaultServerVersionHandler ¶
type DefaultServerVersionHandler struct{}
DefaultServerVersionHandler represents default server handler
func (*DefaultServerVersionHandler) Handle ¶
func (*DefaultServerVersionHandler) Handle(c Conn) error
Handle provide server version handler
type DesktopNamePseudoEncoding ¶
type DesktopNamePseudoEncoding struct {
Name []byte
}
DesktopNamePseudoEncoding represents a desktop size message from the server.
func (*DesktopNamePseudoEncoding) Read ¶
func (enc *DesktopNamePseudoEncoding) Read(c Conn, rect *Rectangle) error
Read implements the Encoding interface.
func (*DesktopNamePseudoEncoding) Reset ¶
func (*DesktopNamePseudoEncoding) Reset() error
func (*DesktopNamePseudoEncoding) Supported ¶
func (*DesktopNamePseudoEncoding) Supported(Conn) bool
func (*DesktopNamePseudoEncoding) Type ¶
func (*DesktopNamePseudoEncoding) Type() EncodingType
type DesktopSizePseudoEncoding ¶
type DesktopSizePseudoEncoding struct{}
DesktopSizePseudoEncoding represents a desktop size message from the server.
func (*DesktopSizePseudoEncoding) Read ¶
func (*DesktopSizePseudoEncoding) Read(c Conn, rect *Rectangle) error
Read implements the Encoding interface.
func (*DesktopSizePseudoEncoding) Reset ¶
func (*DesktopSizePseudoEncoding) Reset() error
func (*DesktopSizePseudoEncoding) Supported ¶
func (*DesktopSizePseudoEncoding) Supported(Conn) bool
func (*DesktopSizePseudoEncoding) Type ¶
func (*DesktopSizePseudoEncoding) Type() EncodingType
type Encoding ¶
type Encoding interface { Type() EncodingType Read(Conn, *Rectangle) error Write(Conn, *Rectangle) error Supported(Conn) bool Reset() error }
Encoding represents interface for vnc encoding
type EncodingType ¶
type EncodingType int32
EncodingType represents a known VNC encoding type.
const ( // EncRaw raw encoding EncRaw EncodingType = 0 // EncCopyRect copyrect encoding EncCopyRect EncodingType = 1 EncRRE EncodingType = 2 EncCoRRE EncodingType = 4 EncHextile EncodingType = 5 EncZlib EncodingType = 6 EncTight EncodingType = 7 EncZlibHex EncodingType = 8 EncUltra1 EncodingType = 9 EncUltra2 EncodingType = 10 EncJPEG EncodingType = 21 EncJRLE EncodingType = 22 EncTRLE EncodingType = 15 EncZRLE EncodingType = 16 EncAtenAST2100 EncodingType = 0x57 EncAtenASTJPEG EncodingType = 0x58 EncAtenHermon EncodingType = 0x59 EncAtenYarkon EncodingType = 0x60 EncAtenPilot3 EncodingType = 0x61 EncJPEGQualityLevelPseudo10 EncodingType = -23 EncJPEGQualityLevelPseudo9 EncodingType = -24 EncJPEGQualityLevelPseudo8 EncodingType = -25 EncJPEGQualityLevelPseudo7 EncodingType = -26 EncJPEGQualityLevelPseudo6 EncodingType = -27 EncJPEGQualityLevelPseudo5 EncodingType = -28 EncJPEGQualityLevelPseudo4 EncodingType = -29 EncJPEGQualityLevelPseudo3 EncodingType = -30 EncJPEGQualityLevelPseudo2 EncodingType = -31 EncJPEGQualityLevelPseudo1 EncodingType = -32 EncPointerPosPseudo EncodingType = -232 EncCursorPseudo EncodingType = -239 EncXCursorPseudo EncodingType = -240 EncDesktopSizePseudo EncodingType = -223 EncLastRectPseudo EncodingType = -224 EncCompressionLevel10 EncodingType = -247 EncCompressionLevel9 EncodingType = -248 EncCompressionLevel8 EncodingType = -249 EncCompressionLevel7 EncodingType = -250 EncCompressionLevel6 EncodingType = -251 EncCompressionLevel5 EncodingType = -252 EncCompressionLevel4 EncodingType = -253 EncCompressionLevel3 EncodingType = -254 EncCompressionLevel2 EncodingType = -255 EncCompressionLevel1 EncodingType = -256 EncQEMUPointerMotionChangePseudo EncodingType = -257 EncQEMUExtendedKeyEventPseudo EncodingType = -258 EncTightPng EncodingType = -260 EncDesktopNamePseudo EncodingType = -307 EncExtendedDesktopSizePseudo EncodingType = -308 EncXvpPseudo EncodingType = -309 EncClientRedirect EncodingType = -311 EncFencePseudo EncodingType = -312 EncContinuousUpdatesPseudo EncodingType = -313 EncExtendedClipboardPseudo EncodingType = -1063131698 //C0A1E5CE )
const ( EncAtenHermonSubrect EncodingType = 0 EncAtenHermonRaw EncodingType = 1 )
func (EncodingType) String ¶
func (i EncodingType) String() string
type FBSPlayHelper ¶
type FBSPlayHelper struct { Conn *FbsConn // contains filtered or unexported fields }
func NewFBSPlayHelper ¶
func NewFBSPlayHelper(r *FbsConn) *FBSPlayHelper
func (*FBSPlayHelper) ReadFbsMessage ¶
func (h *FBSPlayHelper) ReadFbsMessage(SyncWithTimestamps bool, SpeedFactor float64) (ServerMessage, error)
type FbsConn ¶
type FbsConn struct { FbsReader // contains filtered or unexported fields }
Conn represents vnc conection
func (*FbsConn) DesktopName ¶
func (*FbsConn) GetEncInstance ¶
func (c *FbsConn) GetEncInstance(typ EncodingType) Encoding
func (*FbsConn) PixelFormat ¶
func (c *FbsConn) PixelFormat() PixelFormat
func (*FbsConn) SecurityHandler ¶
func (c *FbsConn) SecurityHandler() SecurityHandler
func (*FbsConn) SetColorMap ¶
func (*FbsConn) SetDesktopName ¶
func (*FbsConn) SetEncodings ¶
func (c *FbsConn) SetEncodings([]EncodingType) error
func (*FbsConn) SetPixelFormat ¶
func (c *FbsConn) SetPixelFormat(pf PixelFormat) error
func (*FbsConn) SetProtoVersion ¶
func (*FbsConn) SetSecurityHandler ¶
func (c *FbsConn) SetSecurityHandler(SecurityHandler) error
type FbsReader ¶
type FbsReader struct {
// contains filtered or unexported fields
}
func NewFbsReader ¶
func (*FbsReader) CurrentTimestamp ¶
func (*FbsReader) ReadSegment ¶
func (fbs *FbsReader) ReadSegment() (*FbsSegment, error)
func (*FbsReader) ReadStartSession ¶
func (fbs *FbsReader) ReadStartSession() (*ServerInit, error)
type FbsSegment ¶
type FbsSegment struct {
// contains filtered or unexported fields
}
type FramebufferUpdate ¶
type FramebufferUpdate struct { NumRect uint16 // number-of-rectangles Rects []*Rectangle // rectangles // contains filtered or unexported fields }
FramebufferUpdate holds a FramebufferUpdate wire format message.
func (*FramebufferUpdate) Read ¶
func (*FramebufferUpdate) Read(c Conn) (ServerMessage, error)
Read unmarshal message from conn
func (*FramebufferUpdate) String ¶
func (msg *FramebufferUpdate) String() string
String provide stringer
func (*FramebufferUpdate) Supported ¶
func (msg *FramebufferUpdate) Supported(c Conn) bool
func (*FramebufferUpdate) Type ¶
func (*FramebufferUpdate) Type() ServerMessageType
Type return MessageType
func (*FramebufferUpdate) Write ¶
func (msg *FramebufferUpdate) Write(c Conn) error
Write marshals message to conn
type FramebufferUpdateRequest ¶
type FramebufferUpdateRequest struct { Inc uint8 // incremental X, Y uint16 // x-, y-position Width, Height uint16 // width, height }
FramebufferUpdateRequest holds the wire format message.
func (*FramebufferUpdateRequest) Read ¶
func (*FramebufferUpdateRequest) Read(c Conn) (ClientMessage, error)
Read unmarshal message from conn
func (*FramebufferUpdateRequest) String ¶
func (msg *FramebufferUpdateRequest) String() string
String returns string
func (*FramebufferUpdateRequest) Supported ¶
func (msg *FramebufferUpdateRequest) Supported(c Conn) bool
func (*FramebufferUpdateRequest) Type ¶
func (*FramebufferUpdateRequest) Type() ClientMessageType
Type returns MessageType
func (*FramebufferUpdateRequest) Write ¶
func (msg *FramebufferUpdateRequest) Write(c Conn) error
Write marshal message to conn
type HextileEncoding ¶
func (*HextileEncoding) Reset ¶
func (enc *HextileEncoding) Reset() error
func (*HextileEncoding) SetTargetImage ¶
func (enc *HextileEncoding) SetTargetImage(img draw.Image)
func (*HextileEncoding) Supported ¶
func (*HextileEncoding) Supported(Conn) bool
func (*HextileEncoding) Type ¶
func (z *HextileEncoding) Type() EncodingType
type Key ¶
type Key uint32
Key represents a VNC key press.
const ( Space Key = iota + 0x0020 Exclaim // exclamation mark QuoteDbl NumberSign Dollar Percent Ampersand Apostrophe ParenLeft ParenRight Asterisk Plus Comma Minus Period Slash Digit0 Digit1 Digit2 Digit3 Digit4 Digit5 Digit6 Digit7 Digit8 Digit9 Colon Semicolon Less Equal Greater Question At A B C D E F G H I J K L M N O P Q R S T U V W X Y Z BracketLeft Backslash BracketRight AsciiCircum Underscore Grave SmallA SmallB SmallC SmallD SmallE SmallF SmallG SmallH SmallI SmallJ SmallK SmallL SmallM SmallN SmallO SmallP SmallQ SmallR SmallS SmallT SmallU SmallV SmallW SmallX SmallY SmallZ BraceLeft Bar BraceRight AsciiTilde )
Latin 1 (byte 3 = 0) ISO/IEC 8859-1 = Unicode U+0020..U+00FF
const ( KeypadF1 Key = iota + 0xff91 KeypadF2 KeypadF3 KeypadF4 KeypadHome KeypadLeft KeypadUp KeypadRight KeypadDown KeypadPrior KeypadPageUp KeypadNext KeypadPageDown KeypadEnd KeypadBegin KeypadInsert KeypadDelete KeypadMultiply KeypadAdd KeypadSeparator KeypadSubtract KeypadDecimal KeypadDivide Keypad0 Keypad1 Keypad2 Keypad3 Keypad4 Keypad5 Keypad6 Keypad7 Keypad8 Keypad9 KeypadEqual Key = 0xffbd )
type KeyEvent ¶
type KeyEvent struct { Down uint8 // down-flag Key Key // key // contains filtered or unexported fields }
KeyEvent holds the wire format message.
type PixelFormat ¶
type PixelFormat struct { BPP uint8 // bits-per-pixel Depth uint8 // depth BigEndian uint8 // big-endian-flag TrueColor uint8 // true-color-flag RedMax, GreenMax, BlueMax uint16 // red-, green-, blue-max (2^BPP-1) RedShift, GreenShift, BlueShift uint8 // red-, green-, blue-shift // contains filtered or unexported fields }
PixelFormat describes the way a pixel is formatted for a VNC connection
func NewPixelFormat ¶
func NewPixelFormat(bpp uint8) PixelFormat
NewPixelFormat returns a populated PixelFormat structure
func NewPixelFormatAten ¶
func NewPixelFormatAten() PixelFormat
NewPixelFormatAten returns Aten IKVM pixel format
func (PixelFormat) Marshal ¶
func (pf PixelFormat) Marshal() ([]byte, error)
Marshal implements the Marshaler interface
func (PixelFormat) Read ¶
func (pf PixelFormat) Read(r io.Reader) error
Read reads from an io.Reader, and populates the PixelFormat
func (PixelFormat) String ¶
func (pf PixelFormat) String() string
String implements the fmt.Stringer interface
func (PixelFormat) Unmarshal ¶
func (pf PixelFormat) Unmarshal(data []byte) error
Unmarshal implements the Unmarshaler interface
type PointerEvent ¶
PointerEvent message holds the wire format message
func (*PointerEvent) Read ¶
func (*PointerEvent) Read(c Conn) (ClientMessage, error)
Read unmarshal message from conn
func (*PointerEvent) Supported ¶
func (msg *PointerEvent) Supported(c Conn) bool
func (*PointerEvent) Write ¶
func (msg *PointerEvent) Write(c Conn) error
Write marshal message to conn
type RGBImage ¶
type RGBImage struct { // Pix holds the image's pixels, in R, G, B, A order. The pixel at // (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*3]. Pix []uint8 // Stride is the Pix stride (in bytes) between vertically adjacent pixels. Stride int // Rect is the image's bounds. Rect image.Rectangle }
RGBA is an in-memory image whose At method returns color.RGBA values.
func NewRGBImage ¶
NewRGBA returns a new RGBA image with the given bounds.
func (*RGBImage) ColorModel ¶
type RREEncoding ¶
func (*RREEncoding) Reset ¶
func (enc *RREEncoding) Reset() error
func (*RREEncoding) SetTargetImage ¶
func (enc *RREEncoding) SetTargetImage(img draw.Image)
func (*RREEncoding) Supported ¶
func (*RREEncoding) Supported(Conn) bool
func (*RREEncoding) Type ¶
func (*RREEncoding) Type() EncodingType
type RawEncoding ¶
func (*RawEncoding) Read ¶
func (enc *RawEncoding) Read(c Conn, rect *Rectangle) error
Read implements the Encoding interface.
func (*RawEncoding) Reset ¶
func (*RawEncoding) Reset() error
func (*RawEncoding) SetTargetImage ¶
func (enc *RawEncoding) SetTargetImage(img draw.Image)
func (*RawEncoding) Supported ¶
func (*RawEncoding) Supported(Conn) bool
func (*RawEncoding) Type ¶
func (*RawEncoding) Type() EncodingType
type Rectangle ¶
type Rectangle struct {
X, Y uint16
Width, Height uint16
EncType EncodingType
Enc Encoding
}
Rectangle represents a rectangle of pixel data
type SecurityHandler ¶
type SecurityHandler interface { Type() SecurityType SubType() SecuritySubType Auth(Conn) error }
type SecuritySubType ¶
type SecuritySubType uint32
const ( SecSubTypeVeNCrypt01Unknown SecuritySubType = SecuritySubType(0) SecSubTypeVeNCrypt01Plain SecuritySubType = SecuritySubType(19) SecSubTypeVeNCrypt01TLSNone SecuritySubType = SecuritySubType(20) SecSubTypeVeNCrypt01TLSVNC SecuritySubType = SecuritySubType(21) SecSubTypeVeNCrypt01TLSPlain SecuritySubType = SecuritySubType(22) SecSubTypeVeNCrypt01X509None SecuritySubType = SecuritySubType(23) SecSubTypeVeNCrypt01X509VNC SecuritySubType = SecuritySubType(24) SecSubTypeVeNCrypt01X509Plain SecuritySubType = SecuritySubType(25) )
const ( SecSubTypeVeNCrypt02Unknown SecuritySubType = SecuritySubType(0) SecSubTypeVeNCrypt02Plain SecuritySubType = SecuritySubType(256) SecSubTypeVeNCrypt02TLSNone SecuritySubType = SecuritySubType(257) SecSubTypeVeNCrypt02TLSVNC SecuritySubType = SecuritySubType(258) SecSubTypeVeNCrypt02TLSPlain SecuritySubType = SecuritySubType(259) SecSubTypeVeNCrypt02X509None SecuritySubType = SecuritySubType(260) SecSubTypeVeNCrypt02X509VNC SecuritySubType = SecuritySubType(261) SecSubTypeVeNCrypt02X509Plain SecuritySubType = SecuritySubType(262) )
const (
SecSubTypeUnknown SecuritySubType = SecuritySubType(0)
)
func (SecuritySubType) String ¶
func (i SecuritySubType) String() string
type SecurityType ¶
type SecurityType uint8
const ( SecTypeUnknown SecurityType = SecurityType(0) SecTypeNone SecurityType = SecurityType(1) SecTypeVNC SecurityType = SecurityType(2) SecTypeTight SecurityType = SecurityType(16) SecTypeATEN SecurityType = SecurityType(16) SecTypeVeNCrypt SecurityType = SecurityType(19) SecTypeUltraMsAutoLogon2 SecurityType = SecurityType(113) )
func (SecurityType) String ¶
func (i SecurityType) String() string
type ServerAuthNone ¶
type ServerAuthNone struct{}
ServerAuthNone is the "none" authentication. See 7.2.1.
func (*ServerAuthNone) Auth ¶
func (*ServerAuthNone) Auth(c Conn) error
func (*ServerAuthNone) SubType ¶
func (*ServerAuthNone) SubType() SecuritySubType
func (*ServerAuthNone) Type ¶
func (*ServerAuthNone) Type() SecurityType
type ServerAuthVNC ¶
ServerAuthVNC is the standard password authentication. See 7.2.2.
func (*ServerAuthVNC) Auth ¶
func (auth *ServerAuthVNC) Auth(c Conn) error
func (*ServerAuthVNC) ReadChallenge ¶
func (auth *ServerAuthVNC) ReadChallenge(c Conn) error
func (*ServerAuthVNC) SubType ¶
func (*ServerAuthVNC) SubType() SecuritySubType
func (*ServerAuthVNC) Type ¶
func (*ServerAuthVNC) Type() SecurityType
func (*ServerAuthVNC) WriteChallenge ¶
func (auth *ServerAuthVNC) WriteChallenge(c Conn) error
type ServerConfig ¶
type ServerConfig struct { Handlers []Handler SecurityHandlers []SecurityHandler Encodings []Encoding PixelFormat PixelFormat ColorMap ColorMap ClientMessageCh chan ClientMessage ServerMessageCh chan ServerMessage Messages []ClientMessage DesktopName []byte Height uint16 Width uint16 ErrorCh chan error }
ServerConfig config struct
type ServerConn ¶
type ServerConn struct {
// contains filtered or unexported fields
}
ServerConn underlining server conn
func NewServerConn ¶
func NewServerConn(c net.Conn, cfg *ServerConfig) (*ServerConn, error)
NewServerConn returns new Server connection fron net.Conn
func (*ServerConn) ColorMap ¶
func (c *ServerConn) ColorMap() ColorMap
ColorMap returns server connection color map
func (*ServerConn) Config ¶
func (c *ServerConn) Config() interface{}
Config returns config for server conn
func (*ServerConn) Conn ¶
func (c *ServerConn) Conn() net.Conn
Conn returns underlining server net.Conn
func (*ServerConn) DesktopName ¶
func (c *ServerConn) DesktopName() []byte
DesktopName returns connection desktop name
func (*ServerConn) Encodings ¶
func (c *ServerConn) Encodings() []Encoding
Encodings returns connection encodings
func (*ServerConn) GetEncInstance ¶
func (c *ServerConn) GetEncInstance(typ EncodingType) Encoding
func (*ServerConn) PixelFormat ¶
func (c *ServerConn) PixelFormat() PixelFormat
PixelFormat return connection pixel format
func (*ServerConn) Read ¶
func (c *ServerConn) Read(buf []byte) (int, error)
Read reads data from net.Conn
func (*ServerConn) SecurityHandler ¶
func (c *ServerConn) SecurityHandler() SecurityHandler
SecurityHandler returns security handler
func (*ServerConn) SetColorMap ¶
func (c *ServerConn) SetColorMap(cm ColorMap)
SetColorMap sets connection color map
func (*ServerConn) SetDesktopName ¶
func (c *ServerConn) SetDesktopName(name []byte)
SetDesktopName sets connection desktop name
func (*ServerConn) SetEncodings ¶
func (c *ServerConn) SetEncodings(encs []EncodingType) error
SetEncodings ??? sets server connection encodings
func (*ServerConn) SetHeight ¶
func (c *ServerConn) SetHeight(h uint16)
SetHeight sets framebuffer height
func (*ServerConn) SetPixelFormat ¶
func (c *ServerConn) SetPixelFormat(pf PixelFormat) error
SetPixelFormat sets pixel format for server conn
func (*ServerConn) SetProtoVersion ¶
func (c *ServerConn) SetProtoVersion(pv string)
SetProtoVersion ??? sets proto version
func (*ServerConn) SetSecurityHandler ¶
func (c *ServerConn) SetSecurityHandler(sechandler SecurityHandler) error
SetSecurityHandler sets security handler
func (*ServerConn) SetWidth ¶
func (c *ServerConn) SetWidth(w uint16)
SetWidth sets framebuffer width
type ServerCutText ¶
ServerCutText represents server message
func (*ServerCutText) Read ¶
func (*ServerCutText) Read(c Conn) (ServerMessage, error)
Read unmarshal message from conn
func (*ServerCutText) Supported ¶
func (msg *ServerCutText) Supported(c Conn) bool
func (*ServerCutText) Type ¶
func (*ServerCutText) Type() ServerMessageType
Type returns MessageType
func (*ServerCutText) Write ¶
func (msg *ServerCutText) Write(c Conn) error
Write marshal message to conn
type ServerInit ¶
type ServerInit struct {
FBWidth, FBHeight uint16
PixelFormat PixelFormat
NameLength uint32
NameText []byte
}
ServerInit struct used in server init handshake
type ServerMessage ¶
type ServerMessage interface { String() string Type() ServerMessageType Read(Conn) (ServerMessage, error) Write(Conn) error Supported(Conn) bool }
type ServerMessageType ¶
type ServerMessageType uint8
ServerMessageType represents RFB message type
const ( FramebufferUpdateMsgType ServerMessageType = iota SetColorMapEntriesMsgType BellMsgType ServerCutTextMsgType )
Server-to-Client message types
const ( AteniKVMFrontGroundEventMsgType ServerMessageType = 4 AteniKVMKeepAliveEventMsgType ServerMessageType = 22 AteniKVMVideoGetInfoMsgType ServerMessageType = 51 AteniKVMMouseGetInfoMsgType ServerMessageType = 55 AteniKVMSessionMessageMsgType ServerMessageType = 57 AteniKVMGetViewerLangMsgType ServerMessageType = 60 )
Aten IKVM server message types
type SetColorMapEntries ¶
type SetColorMapEntries struct { FirstColor uint16 ColorsNum uint16 Colors []Color // contains filtered or unexported fields }
SetColorMapEntries server message
func (*SetColorMapEntries) Read ¶
func (*SetColorMapEntries) Read(c Conn) (ServerMessage, error)
Read unmrashal message from conn
func (*SetColorMapEntries) String ¶
func (msg *SetColorMapEntries) String() string
String returns string
func (*SetColorMapEntries) Supported ¶
func (msg *SetColorMapEntries) Supported(c Conn) bool
func (*SetColorMapEntries) Type ¶
func (*SetColorMapEntries) Type() ServerMessageType
Type returns MessageType
func (*SetColorMapEntries) Write ¶
func (msg *SetColorMapEntries) Write(c Conn) error
Write marshal message to conn
type SetEncodings ¶
type SetEncodings struct { EncNum uint16 // number-of-encodings Encodings []EncodingType // contains filtered or unexported fields }
SetEncodings holds the wire format message, sans encoding-type field.
func (*SetEncodings) Read ¶
func (*SetEncodings) Read(c Conn) (ClientMessage, error)
Read unmarshal message from conn
func (*SetEncodings) Supported ¶
func (msg *SetEncodings) Supported(c Conn) bool
func (*SetEncodings) Write ¶
func (msg *SetEncodings) Write(c Conn) error
Write marshal message to conn
type SetPixelFormat ¶
type SetPixelFormat struct { PF PixelFormat // pixel-format // contains filtered or unexported fields }
SetPixelFormat holds the wire format message.
func (*SetPixelFormat) Read ¶
func (*SetPixelFormat) Read(c Conn) (ClientMessage, error)
Read unmarshal message from conn
func (*SetPixelFormat) Supported ¶
func (msg *SetPixelFormat) Supported(c Conn) bool
func (*SetPixelFormat) Type ¶
func (*SetPixelFormat) Type() ClientMessageType
Type returns MessageType
func (*SetPixelFormat) Write ¶
func (msg *SetPixelFormat) Write(c Conn) error
Write marshal message to conn
type TightCC ¶
type TightCC struct { Compression TightCompression Filter TightFilter }
type TightCompression ¶
type TightCompression uint8
func (TightCompression) String ¶
func (i TightCompression) String() string
type TightEncoding ¶
func (*TightEncoding) GetInstance ¶
func (*TightEncoding) GetInstance() *TightEncoding
func (*TightEncoding) ReadTightData ¶
func (*TightEncoding) Reset ¶
func (enc *TightEncoding) Reset() error
func (*TightEncoding) SetTargetImage ¶
func (enc *TightEncoding) SetTargetImage(img draw.Image)
func (*TightEncoding) Supported ¶
func (*TightEncoding) Supported(Conn) bool
func (*TightEncoding) Type ¶
func (*TightEncoding) Type() EncodingType
type TightFilter ¶
type TightFilter uint8
func (TightFilter) String ¶
func (i TightFilter) String() string
type TightPixel ¶
type TightPngEncoding ¶
func (*TightPngEncoding) Reset ¶
func (*TightPngEncoding) Reset() error
func (*TightPngEncoding) SetTargetImage ¶
func (enc *TightPngEncoding) SetTargetImage(img draw.Image)
func (*TightPngEncoding) Supported ¶
func (*TightPngEncoding) Supported(Conn) bool
func (*TightPngEncoding) Type ¶
func (*TightPngEncoding) Type() EncodingType
type VncCanvas ¶
type VncCanvas struct { draw.Image Cursor draw.Image CursorMask [][]bool CursorBackup draw.Image CursorOffset *image.Point CursorLocation *image.Point DrawCursor bool Changed map[string]bool // contains filtered or unexported fields }
func NewVncCanvas ¶
func (*VncCanvas) PaintCursor ¶
func (*VncCanvas) RemoveCursor ¶
func (*VncCanvas) SetChanged ¶
type VncStreamFileReader ¶
type VncStreamFileReader interface { io.Reader CurrentTimestamp() int ReadStartSession() (*ServerInit, error) CurrentPixelFormat() *PixelFormat Encodings() []Encoding }
type XCursorPseudoEncoding ¶
type XCursorPseudoEncoding struct { PrimaryR uint8 PrimaryG uint8 PrimaryB uint8 SecondaryR uint8 SecondaryG uint8 SecondaryB uint8 Bitmap []byte Bitmask []byte }
func (*XCursorPseudoEncoding) Read ¶
func (enc *XCursorPseudoEncoding) Read(c Conn, rect *Rectangle) error
Read implements the Encoding interface.
func (*XCursorPseudoEncoding) Reset ¶
func (*XCursorPseudoEncoding) Reset() error
func (*XCursorPseudoEncoding) Supported ¶
func (*XCursorPseudoEncoding) Supported(Conn) bool
func (*XCursorPseudoEncoding) Type ¶
func (*XCursorPseudoEncoding) Type() EncodingType
type ZLibEncoding ¶
func (*ZLibEncoding) Reset ¶
func (enc *ZLibEncoding) Reset() error
func (*ZLibEncoding) SetTargetImage ¶
func (enc *ZLibEncoding) SetTargetImage(img draw.Image)
func (*ZLibEncoding) Supported ¶
func (*ZLibEncoding) Supported(Conn) bool
func (*ZLibEncoding) Type ¶
func (*ZLibEncoding) Type() EncodingType
type ZRLEEncoding ¶
func (*ZRLEEncoding) Reset ¶
func (enc *ZRLEEncoding) Reset() error
func (*ZRLEEncoding) SetTargetImage ¶
func (enc *ZRLEEncoding) SetTargetImage(img draw.Image)
func (*ZRLEEncoding) Supported ¶
func (*ZRLEEncoding) Supported(Conn) bool
func (*ZRLEEncoding) Type ¶
func (*ZRLEEncoding) Type() EncodingType
Source Files ¶
- button_string.go
- buttons.go
- client.go
- clientmessagetype_string.go
- conn.go
- encoding.go
- encoding_atenhermon.go
- encoding_copyrect.go
- encoding_corre.go
- encoding_cursor.go
- encoding_desktopname.go
- encoding_desktopsize.go
- encoding_hextile.go
- encoding_pointer_pos.go
- encoding_raw.go
- encoding_rre.go
- encoding_tight.go
- encoding_tightpng.go
- encoding_util.go
- encoding_xcursor.go
- encoding_zlib.go
- encoding_zrle.go
- encodingtype_string.go
- fbs-connection.go
- fbs-reader.go
- handlers.go
- image.go
- key_string.go
- keys.go
- messages.go
- messages_aten.go
- pixel_format.go
- rgb-image.go
- security.go
- security_aten.go
- security_none.go
- security_tight.go
- security_ultra_ms_auto_logon_2.go
- security_vencryptplain.go
- security_vnc.go
- securitysubtype_string.go
- securitytype_string.go
- server.go
- tightcompression_string.go
- tightfilter_string.go