Remote Access Operations
AgentStation provides a set of remote access operations that allow you to interact with and control workstations remotely. These operations are designed to facilitate seamless integration and management of workstations in your applications.
Remote Connection Types
AgentStation supports multiple protocols for remote access, each suited for different use cases:
-
VNC (Virtual Network Computing):
- Provides full graphical remote desktop access.
- Ideal for visual interactions and GUI-based tasks.
-
SSH (Secure Shell):
- Offers secure command-line access to the workstation.
- Perfect for running scripts, managing files, and performing system-level operations.
-
RFB (Remote Framebuffer Protocol):
- The protocol underlying VNC, providing low-level access to the graphical interface.
- Useful for custom implementations or when fine-grained control over the remote display is needed.
-
Chrome DevTools Protocol:
- Enables direct interaction with Chrome/Chromium browsers running on the workstation.
- Excellent for web automation, debugging, and performance analysis of web applications.
Remote Connection Management
The Remote Access API provides two main operations for managing remote connections to workstations:
- Connect: Establish a remote connection to a workstation using one of the supported protocols.
- Disconnect: Terminate an existing remote connection.
Connecting to a Workstation
To initiate a remote connection, use the POST /workstations/{workstation_id}/remote/connect
endpoint. This operation allows you to specify the protocol for the remote connection.
Key points:
- Requires the workstation ID as a path parameter.
- Accepts a request body specifying the connection details, including the chosen protocol.
- Returns connection information upon successful connection, such as URL and authentication details.
Disconnecting from a Workstation
To terminate a remote connection, use the POST /workstations/{workstation_id}/remote/disconnect
endpoint. This operation safely closes the remote session.
Key points:
- Requires the workstation ID as a path parameter.
- Accepts a request body with disconnection details, including the protocol being disconnected.
- Confirms successful disconnection.
Best Practices for Remote Access
When working with remote access operations:
-
Security:
- Always use secure protocols (SSH, VNC with encryption) when possible.
- Manage credentials carefully and avoid hardcoding them in your application.
-
Connection Management:
- Properly close connections when they're no longer needed to free up resources.
- Implement connection pooling for frequently accessed workstations to improve performance.
-
Protocol Selection:
- Choose the appropriate protocol based on your task requirements:
- Use SSH for command-line operations and script execution.
- Opt for VNC or RFB when graphical interaction is necessary.
- Leverage Chrome DevTools Protocol for web-specific tasks and browser automation.
- Choose the appropriate protocol based on your task requirements:
-
Error Handling:
- Implement robust error handling to manage connection issues or timeouts.
- Consider implementing automatic reconnection logic for unstable networks.
-
Rate Limiting:
- Be aware of any rate limits on connection attempts to avoid overloading the system.
- Implement exponential backoff for retry attempts.
Integration with Other Workstation Operations
Remote access operations can be combined with other workstation actions to create powerful automated workflows. For example:
- Use SSH to set up the environment before running GUI-based tasks via VNC.
- Leverage Chrome DevTools Protocol for web scraping or testing, then use SSH to process the collected data.
- Utilize VNC for visual verification of AI or voice operation results.
- Combine RFB with custom image processing for advanced GUI automation tasks.
By leveraging these remote access operations and choosing the appropriate protocol for each task, developers can create sophisticated applications that interact with workstations in a controlled and efficient manner, enabling a wide range of automation and management scenarios.