Documentation
¶
Index ¶
- func GenerateTestKeys(hostKeyPath, clientKeyPath, authKeysPath string) error
- type Client
- type EventHandler
- type MouseEvent
- type SSHClient
- func (c *SSHClient) Connect(ctx context.Context, serverAddr string) error
- func (c *SSHClient) Disconnect() error
- func (c *SSHClient) IsConnected() bool
- func (c *SSHClient) OnInputEvent(callback func(*protocol.InputEvent))
- func (c *SSHClient) Reconnect(ctx context.Context, serverAddr string) error
- func (c *SSHClient) SendInputEvent(event *protocol.InputEvent) error
- type SSHServer
- func (s *SSHServer) GetClientSessions() map[string]string
- func (s *SSHServer) IsSSHEnabled() bool
- func (s *SSHServer) Port() int
- func (s *SSHServer) SendEventToClient(clientAddr string, event *protocol.InputEvent) error
- func (s *SSHServer) SendInputEventToAllClients(event *protocol.InputEvent) error
- func (s *SSHServer) SendInputEventToClient(sessionID string, event *protocol.InputEvent) error
- func (s *SSHServer) SetAuthHandlers(onAuthRequest func(addr, publicKey, fingerprint string) bool)
- func (s *SSHServer) SetMaxClients(max int)
- func (s *SSHServer) Start(ctx context.Context) error
- func (s *SSHServer) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateTestKeys ¶
GenerateTestKeys generates RSA keys for testing
Types ¶
type Client ¶
type Client interface {
Connect(ctx context.Context, serverAddr string) error
Disconnect() error
IsConnected() bool
Reconnect(ctx context.Context, serverAddr string) error
SendMouseEvent(event *MouseEvent) error
SendMouseBatch(events []*MouseEvent) error
}
Client defines the interface for network clients
type EventHandler ¶
type EventHandler func(event *MouseEvent) error
EventHandler is a callback for handling mouse events
type MouseEvent ¶
type MouseEvent struct {
*waymonProto.MouseEvent
}
MouseEvent wraps the protobuf mouse event for internal use
type SSHClient ¶
type SSHClient struct {
// contains filtered or unexported fields
}
SSHClient handles SSH connections to the server
func NewSSHClient ¶
NewSSHClient creates a new SSH client
func (*SSHClient) Disconnect ¶
Disconnect closes the SSH connection
func (*SSHClient) IsConnected ¶
IsConnected returns true if connected to the server
func (*SSHClient) OnInputEvent ¶
func (c *SSHClient) OnInputEvent(callback func(*protocol.InputEvent))
OnInputEvent sets the callback for receiving input events from server
func (*SSHClient) SendInputEvent ¶
func (c *SSHClient) SendInputEvent(event *protocol.InputEvent) error
SendInputEvent sends an input event to the server
type SSHServer ¶
type SSHServer struct {
// Event handlers
OnInputEvent func(event *protocol.InputEvent)
OnClientConnected func(addr string, publicKey string)
OnClientDisconnected func(addr string)
OnAuthRequest func(addr, publicKey, fingerprint string) bool // Returns approval
// contains filtered or unexported fields
}
SSHServer handles incoming connections over SSH
func NewSSHServer ¶
NewSSHServer creates a new SSH-based server
func (*SSHServer) GetClientSessions ¶
GetClientSessions returns a map of sessionID -> client address for connected clients
func (*SSHServer) IsSSHEnabled ¶
IsSSHEnabled returns true since this is an SSH server
func (*SSHServer) SendEventToClient ¶
func (s *SSHServer) SendEventToClient(clientAddr string, event *protocol.InputEvent) error
SendEventToClient sends an input event to a specific client by address
func (*SSHServer) SendInputEventToAllClients ¶
func (s *SSHServer) SendInputEventToAllClients(event *protocol.InputEvent) error
SendInputEventToAllClients sends an input event to all connected clients
func (*SSHServer) SendInputEventToClient ¶
func (s *SSHServer) SendInputEventToClient(sessionID string, event *protocol.InputEvent) error
SendInputEventToClient sends an input event to a specific client
func (*SSHServer) SetAuthHandlers ¶
SetAuthHandlers sets the authentication callback handlers
func (*SSHServer) SetMaxClients ¶
SetMaxClients sets the maximum number of concurrent clients