Documentation ¶
Index ¶
- type ButtonMask
- type ClientAuth
- type ClientAuthNone
- type ClientConfig
- type ClientConn
- func (c *ClientConn) Close() error
- func (conn *ClientConn) Connect() error
- func (c *ClientConn) CurrentPixelFormat() *common.PixelFormat
- func (c *ClientConn) CutText(text string) error
- func (c *ClientConn) Encodings() []common.IEncoding
- func (c *ClientConn) FramebufferUpdateRequest(incremental bool, x, y, width, height uint16) error
- func (c *ClientConn) KeyEvent(keysym uint32, down bool) error
- func (c *ClientConn) PointerEvent(mask ButtonMask, x, y uint16) error
- func (c *ClientConn) Read(bytes []byte) (n int, err error)
- func (c *ClientConn) SetEncodings(encs []common.IEncoding) error
- func (c *ClientConn) SetPixelFormat(format *common.PixelFormat) error
- func (c *ClientConn) Write(bytes []byte) (n int, err error)
- type MsgBell
- type MsgFramebufferUpdate
- type MsgServerCutText
- type MsgServerFence
- type MsgSetColorMapEntries
- type PasswordAuth
- type WriteTo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ButtonMask ¶
type ButtonMask uint8
ButtonMask represents a mask of pointer presses/releases.
const ( ButtonLeft ButtonMask = 1 << iota ButtonMiddle ButtonRight Button4 Button5 Button6 Button7 Button8 )
All available button mask components.
type ClientAuth ¶
type ClientAuth interface { // SecurityType returns the byte identifier sent by the server to // identify this authentication scheme. SecurityType() uint8 // Handshake is called when the authentication handshake should be // performed, as part of the general RFB handshake. (see 7.2.1) Handshake(io.ReadWriteCloser) error }
A ClientAuth implements a method of authenticating with a remote server.
type ClientAuthNone ¶
type ClientAuthNone byte
ClientAuthNone is the "none" authentication. See 7.2.1
func (*ClientAuthNone) Handshake ¶
func (*ClientAuthNone) Handshake(closer io.ReadWriteCloser) error
func (*ClientAuthNone) SecurityType ¶
func (*ClientAuthNone) SecurityType() uint8
type ClientConfig ¶
type ClientConfig struct { // A slice of ClientAuth methods. Only the first instance that is // suitable by the server will be used to authenticate. Auth []ClientAuth // Exclusive determines whether the connection is shared with other // clients. If true, then all other clients connected will be // disconnected when a connection is established to the VNC server. Exclusive bool // A slice of supported messages that can be read from the server. // This only needs to contain NEW server messages, and doesn't // need to explicitly contain the RFC-required messages. ServerMessages []common.ServerMessage }
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 { // If the pixel format uses a color map, then this is the color // map that is used. This should not be modified directly, since // the data comes from the server. ColorMap common.ColorMap // Encodings supported by the client. This should not be modified // directly. Instead, SetEncodings should be used. Encs []common.IEncoding // Width of the frame buffer in pixels, sent from the server. FrameBufferWidth uint16 // Height of the frame buffer in pixels, sent from the server. FrameBufferHeight uint16 // Name associated with the desktop, sent from the server. DesktopName string // The pixel format associated with the connection. This shouldn't // be modified. If you wish to set a new pixel format, use the // SetPixelFormat method. PixelFormat common.PixelFormat Listeners *common.MultiListener // contains filtered or unexported fields }
func NewClientConn ¶
func NewClientConn(c net.Conn, cfg *ClientConfig) (*ClientConn, error)
func (*ClientConn) Close ¶
func (c *ClientConn) Close() error
func (*ClientConn) Connect ¶
func (conn *ClientConn) Connect() error
func (*ClientConn) CurrentPixelFormat ¶
func (c *ClientConn) CurrentPixelFormat() *common.PixelFormat
func (*ClientConn) CutText ¶
func (c *ClientConn) CutText(text string) error
CutText tells the server that the client has new text in its cut buffer. The text string MUST only contain Latin-1 characters. This encoding is compatible with Go's native string format, but can only use up to unicode.MaxLatin values.
func (*ClientConn) Encodings ¶
func (c *ClientConn) Encodings() []common.IEncoding
func (*ClientConn) FramebufferUpdateRequest ¶
func (c *ClientConn) FramebufferUpdateRequest(incremental bool, x, y, width, height uint16) error
Requests a framebuffer update from the server. There may be an indefinite time between the request and the actual framebuffer update being received.
func (*ClientConn) KeyEvent ¶
func (c *ClientConn) KeyEvent(keysym uint32, down bool) error
KeyEvent indiciates a key press or release and sends it to the server. The key is indicated using the X Window System "keysym" value. Use Google to find a reference of these values. To simulate a key press, you must send a key with both a down event, and a non-down event.
See 7.5.4.
func (*ClientConn) PointerEvent ¶
func (c *ClientConn) PointerEvent(mask ButtonMask, x, y uint16) error
PointerEvent indicates that pointer movement or a pointer button press or release.
The mask is a bitwise mask of various ButtonMask values. When a button is set, it is pressed, when it is unset, it is released.
func (*ClientConn) SetEncodings ¶
func (c *ClientConn) SetEncodings(encs []common.IEncoding) error
SetEncodings sets the encoding types in which the pixel data can be sent from the server. After calling this method, the encs slice given should not be modified.
func (*ClientConn) SetPixelFormat ¶
func (c *ClientConn) SetPixelFormat(format *common.PixelFormat) error
SetPixelFormat sets the format in which pixel values should be sent in FramebufferUpdate messages from the server.
type MsgBell ¶
type MsgBell byte
Bell signals that an audible bell should be made on the client.
func (*MsgBell) Read ¶
func (m *MsgBell) Read(c common.IClientConn, r *common.RfbReadHelper) (common.ServerMessage, error)
type MsgFramebufferUpdate ¶
MsgFramebufferUpdate consists of a sequence of rectangles of pixel data that the client should put into its framebuffer.
func (*MsgFramebufferUpdate) CopyTo ¶
func (fbm *MsgFramebufferUpdate) CopyTo(r io.Reader, w io.Writer, c common.IClientConn) error
func (*MsgFramebufferUpdate) Read ¶
func (fbm *MsgFramebufferUpdate) Read(c common.IClientConn, r *common.RfbReadHelper) (common.ServerMessage, error)
func (*MsgFramebufferUpdate) String ¶
func (m *MsgFramebufferUpdate) String() string
func (*MsgFramebufferUpdate) Type ¶
func (*MsgFramebufferUpdate) Type() uint8
type MsgServerCutText ¶
type MsgServerCutText struct {
Text string
}
MsgServerCutText indicates the server has new text in the cut buffer.
func (*MsgServerCutText) CopyTo ¶
func (fbm *MsgServerCutText) CopyTo(r io.Reader, w io.Writer, c common.IClientConn) error
func (*MsgServerCutText) Read ¶
func (m *MsgServerCutText) Read(conn common.IClientConn, r *common.RfbReadHelper) (common.ServerMessage, error)
func (*MsgServerCutText) String ¶
func (m *MsgServerCutText) String() string
func (*MsgServerCutText) Type ¶
func (*MsgServerCutText) Type() uint8
type MsgServerFence ¶
type MsgServerFence byte
func (*MsgServerFence) CopyTo ¶
func (fbm *MsgServerFence) CopyTo(r io.Reader, w io.Writer, c common.IClientConn) error
func (*MsgServerFence) Read ¶
func (sf *MsgServerFence) Read(info common.IClientConn, c *common.RfbReadHelper) (common.ServerMessage, error)
func (*MsgServerFence) String ¶
func (m *MsgServerFence) String() string
func (*MsgServerFence) Type ¶
func (*MsgServerFence) Type() uint8
type MsgSetColorMapEntries ¶
MsgSetColorMapEntries is sent by the server to set values into the color map. This message will automatically update the color map for the associated connection, but contains the color change data if the consumer wants to read it.
func (*MsgSetColorMapEntries) CopyTo ¶
func (fbm *MsgSetColorMapEntries) CopyTo(r io.Reader, w io.Writer, c common.IClientConn) error
func (*MsgSetColorMapEntries) Read ¶
func (m *MsgSetColorMapEntries) Read(c common.IClientConn, r *common.RfbReadHelper) (common.ServerMessage, error)
func (*MsgSetColorMapEntries) String ¶
func (m *MsgSetColorMapEntries) String() string
func (*MsgSetColorMapEntries) Type ¶
func (*MsgSetColorMapEntries) Type() uint8
type PasswordAuth ¶
type PasswordAuth struct {
Password string
}
PasswordAuth is VNC authentication, 7.2.2
func (*PasswordAuth) Handshake ¶
func (p *PasswordAuth) Handshake(c io.ReadWriteCloser) error
func (*PasswordAuth) SecurityType ¶
func (p *PasswordAuth) SecurityType() uint8