- Add devid, group, destaddr, and https fields to HttpProxySession for better session tracking and logging.
- Refactor doHttpProxy to use only the rtty-http-sid cookie for session lookup, removing dependencies on group, devid, proto, and destaddr cookies.
- In httpProxyRedirect, store all necessary session info in HttpProxySession and set only the rtty-http-sid cookie.
- Unify logging to use the session string for easier debugging.
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
- Add horizontal and vertical split options to context menu
- Support recursive splitting for complex terminal layouts
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
- Move empty password check from httpLogin to httpAuth
- httpLogin now only validates actual password comparison
- httpAuth handles empty password as authentication bypass
- This ensures consistent authentication behavior across all endpoints
Previously, empty password would always return true in httpLogin,
now it's properly handled at the authentication middleware level.
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
- Add viewport boundary detection to prevent menu overflow
- Auto-adjust menu position when near screen edges
- Ensure menu stays within visible area with 15px margin
- Use $nextTick to calculate position after DOM update
This prevents context menu from being cut off when right-clicking
near screen boundaries, especially in bottom-right corner.
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
- Detect clipboard permission errors and show user-friendly instructions
- Add fallback to Shift+Insert shortcut for unsupported scenarios
- Implement unified clipboard permission guidance with i18n support
- Improve error handling for better user
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
This prevents users from seeing a blank terminal while waiting for the WebSocket
connection to establish and the login process to complete.
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
- Extract login waiting logic into separate waitForLogin function for better code organization
- Fix race condition between timeout and device response by using LoadAndDelete atomically
- Continue waiting for device response if timeout occurs but device has already responded
This refactoring ensures robust handling of the login process even when timeout and
device response
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
When WebSocket connection fails due to 403 unauthorized status from server,
browser WebSocket API cannot distinguish HTTP status codes and only fires
a generic 'error' event. Redirect to /connect/:devid HTTP endpoint so that
browser can properly capture and handle the 403 status code response.
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
- Forward all original HTTP headers plus custom rttys headers:
- X-Rttys-Hook: true
- X-Original-Method: original request method
- X-Original-URL: original request URL
- Hook must return HTTP 200 to allow API access.
This enables external services to validate and control user API access
by receiving the complete original request context through HTTP hooks.
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
- Add pasteFromClipboard() method to enable direct clipboard paste
- Use Clipboard API with async/await for modern browser support
- Add fallback message for unsupported browsers or permission denied
- Add 'Pasted from clipboard' translations for English and Chinese
- Replace paste menu item action from showing instruction to actual paste
This allows users to paste content directly from the context menu instead
of requiring keyboard shortcuts, improving user experience.
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>