Documentation
¶
Overview ¶
Package rfb implements the minimal RFB (VNC) protocol pieces ShellCN needs: a gateway-side handshake toward the browser using Security None (shared by the VNC and RDP plugins) plus upstream VNC authentication. The browser renders the stream with noVNC; ShellCN never exposes the upstream password to the client.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialVNC ¶
func DialVNC(conn io.ReadWriter, password string) ([]byte, error)
DialVNC performs the client-side RFB 3.8 handshake and authentication against an upstream VNC server reachable over conn. On success conn is positioned immediately after ServerInit, and the returned bytes are the ServerInit message to forward to the browser verbatim. Only the count-prefixed security list of RFB 3.7+/3.8 is supported.
func ServerHandshakeNone ¶
func ServerHandshakeNone(client io.ReadWriter) error
ServerHandshakeNone performs the gateway-side RFB 3.8 handshake toward the browser using Security type None — the gateway has already authenticated upstream, so the client never sees a password challenge. After it returns the caller must write the ServerInit message; from then on the connection carries raw RFB bytes.
Types ¶
type FramebufferServer ¶
type FramebufferServer struct {
// contains filtered or unexported fields
}
FramebufferServer renders a synthetic RFB session to the browser. A protocol plugin (RDP) feeds decoded bitmaps via PushBitmap and receives input through an InputSink. Updates are coalesced and flushed only when the client has an outstanding FramebufferUpdateRequest, as the RFB protocol requires.
func NewFramebufferServer ¶
func NewFramebufferServer(rw io.ReadWriter, width, height int) *FramebufferServer
NewFramebufferServer creates a server for a width×height desktop writing to rw.
func (*FramebufferServer) PushBitmap ¶
func (s *FramebufferServer) PushBitmap(x, y, w, h, srcBytesPerPixel int, data []byte)
PushBitmap copies a decoded rectangle into the backing framebuffer (converting from the source bytes-per-pixel) and marks it dirty. grdp's bitmap decoders already emit top-down rows — they un-flip RDP's bottom-up wire format during decode — so a source row maps straight to the destination row.
func (*FramebufferServer) Serve ¶
func (s *FramebufferServer) Serve(sink InputSink) error
Serve performs the gateway handshake, sends ServerInit, then runs the read and write pumps until the client disconnects or an error occurs.
type InputSink ¶
type InputSink interface {
KeyEvent(down bool, keysym uint32)
PointerEvent(buttonMask uint8, x, y int)
}
InputSink receives the browser's input events, translated by the consuming plugin (e.g. RDP) into its own protocol.