webssh2_client 0.2.25 → 0.2.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,35 +2,21 @@
2
2
 
3
3
  ![Orthrus Mascot](images/orthrus.png)
4
4
 
5
- WebSSH2 Client is an HTML5 web-based terminal emulator and SSH client. It uses WebSockets to communicate with a WebSSH2 server, which in turn uses SSH2 to connect to SSH servers.
5
+ WebSSH2 Client is an HTML5 web-based terminal emulator and SSH client component. It uses WebSockets to communicate with a WebSSH2 server, which in turn uses SSH2 to connect to SSH servers.
6
6
 
7
7
  ![WebSSH2 demo](https://user-images.githubusercontent.com/1668075/182425293-acc8741e-cc92-4105-afdc-9538e1685d4b.gif)
8
8
 
9
- # EXPERIMENTAL
10
- The current status is experimental, and this first version is a refactor of webssh2 v0.2.x to be compatible with a refactor of the same version of webssh2 as a stand-alone server-side component running Node.js v6.9.1.
9
+ # Important Notice
10
+ This package contains only the browser-side client component of WebSSH2. It requires a compatible WebSSH2 server to function. The server component is available at [webssh2 server](https://github.com/billchurch/webssh2/tree/bigip-server). This package is intended for advanced users who want to customize or integrate the client component independently.
11
11
 
12
- The intention is to harmonize the latest release of webssh2 by splitting out the client and server as separate repos (webssh2-client and webssh2-server) but joining them both together as modules in a parent webssh2 in an attempt to provide backward compatibility.
13
-
14
- The main idea behind bifurcating the client/server is to make it easier to customize the client to work in other frameworks and use cases.
15
-
16
- ## Table of Contents
17
-
18
- - [Requirements](#requirements)
19
- - [Installation](#installation)
20
- - [Usage](#usage)
21
- - [Configuration](#configuration)
22
- - [Features](#features)
23
- - [Routes](#routes)
24
- - [Development](#development)
25
- - [Advanced Configuration](#advanced-configuration)
26
- - [Support](#support)
27
- - [License](#license)
28
- - [Acknowledgments](#acknowledgments)
12
+ # Status
13
+ This is an experimental refactor of the WebSSH2 v0.2.x client to function as a standalone component. It has been separated from the server-side code to facilitate customization and integration with different frameworks.
29
14
 
30
15
  ## Requirements
31
16
 
32
17
  - Modern web browser with JavaScript enabled
33
- - WebSSH2 server (see server README for setup instructions)
18
+ - Compatible WebSSH2 server instance (v0.2.x or compatible)
19
+ - Socket.IO v2.2.0 compatibility (due to server requirements)
34
20
 
35
21
  ## Installation
36
22
 
@@ -52,172 +38,91 @@ The main idea behind bifurcating the client/server is to make it easier to custo
52
38
 
53
39
  4. The built client files will be in the `client/public` directory.
54
40
 
55
- ## Usage
56
-
57
- 1. Set up and start the WebSSH2 server (see server README for instructions).
58
-
59
- 2. Access the web client by navigating to the server's URL, typically:
60
- ```
61
- http://localhost:2222/ssh
62
- ```
63
-
64
- 3. You'll be prompted for host details and SSH credentials.
41
+ ## Server Requirements
65
42
 
66
- ## Configuration
43
+ The WebSSH2 client requires a compatible server that provides:
67
44
 
68
- The client can be configured using URL parameters or through the config file on the server. Some configurable options include:
45
+ - WebSocket endpoint for SSH communication
46
+ - Authentication handling
47
+ - SSH connection management
48
+ - Socket.IO v2.2.0 compatibility
69
49
 
70
- - `port` - SSH server port (default: 22)
71
- - `header` - Optional header text
72
- - `headerBackground` - Optional header background color
73
- - `sshterm` - Terminal type for pty (default: xterm-color)
50
+ For server setup instructions, refer to the [WebSSH2 server documentation](https://github.com/billchurch/webssh2/tree/bigip-server).
74
51
 
75
- For a full list of configuration options, refer to the server README.
76
-
77
- ## Features
52
+ ## Client Features
78
53
 
79
54
  - Web-based SSH client with xterm.js terminal emulation
80
- - Supports various SSH authentication methods (password and keyboard-interactive)
81
- - Customizable terminal settings (font size, font family, colors, etc.)
82
- - Session logging with download option
83
- - Support for reauthentication and credential replay
84
- - Responsive design for various screen sizes
85
- - Keyboard shortcuts support
86
- - Terminal Mouse support
55
+ - Customizable terminal settings:
56
+ - Font size and family
57
+ - Color schemes
58
+ - Cursor behavior
59
+ - Scrollback buffer size
60
+ - Session logging with download capability
87
61
  - Copy and paste functionality
88
- - Multi-factor authentication support
89
- - CORS support for flexible server setups
90
-
91
- ## Routes
92
-
93
- The WebSSH2 Server (not provided by this package) provides two main routes:
94
-
95
- ### 1. `/ssh`
96
-
97
- - Interactive login form
98
- - Terminal configuration options
99
-
100
- ### 2. `/ssh/host/:host`
62
+ - Terminal mouse support
63
+ - Keyboard shortcuts
64
+ - Responsive design
65
+ - Multi-factor authentication support (when supported by server)
66
+ - Support for credential replay and reauthentication
101
67
 
102
- - Quick connections to specific hosts
103
- - Optional `port` parameter (e.g., `?port=2222`)
104
- - HTTP Basic Authentication for credentials
68
+ ## Configuration
105
69
 
106
- ## Development
70
+ The client can be configured through:
107
71
 
108
- - To add custom JavaScript, modify `./src/client.htm`, `./src/index.js`, or add your file to `webpack.*.js`.
109
- - For security, use HTTPS when transmitting credentials via HTTP Basic Auth.
110
- - Terminal settings can be customized after login via `Menu | Settings` and persist across sessions.
111
- - Debug mode can be enabled by setting the `DEBUG` environment variable.
72
+ 1. URL parameters
73
+ 2. Configuration object
74
+ 3. User interface settings
112
75
 
113
- ## Advanced Configuration
76
+ ### URL Parameters
114
77
 
115
- In the client HTML file, you'll find this script tag:
78
+ Supported URL parameters include:
116
79
 
117
- ```html
118
- <script>
119
- window.webssh2Config = null;
120
- </script>
121
- ```
122
-
123
- The WebSSH2 server replaces this null value with a configuration object. However, you can also set this manually to override server-provided settings or to configure the client when using it standalone.
80
+ - `host` - SSH server hostname
81
+ - `port` - SSH server port (default: 22)
82
+ - `header` - Optional header text
83
+ - `headerBackground` - Optional header background color
84
+ - `sshterm` - Terminal type (default: xterm-color)
124
85
 
125
- ### Configuration Options
86
+ ### Configuration Object
126
87
 
127
- Here's a comprehensive list of parameters that can be injected using `window.webssh2Config`:
88
+ You can configure the client by setting `window.webssh2Config`:
128
89
 
129
90
  ```javascript
130
91
  window.webssh2Config = {
131
92
  socket: {
132
- url: null, // WebSocket URL. If null, it will be automatically determined
133
- path: '/ssh/socket.io', // Socket.IO path
93
+ url: null, // WebSocket URL (auto-detected if null)
94
+ path: '/ssh/socket.io' // Socket.IO path
134
95
  },
135
96
  ssh: {
136
- host: null, // SSH server hostname (required for autoConnect)
137
- port: 22, // SSH server port
138
- username: null, // SSH username (required for autoConnect)
139
- password: null, // SSH password (required for autoConnect)
140
- sshterm: 'xterm-color', // Terminal type
141
- readyTimeout: 20000, // SSH connection timeout (ms)
97
+ host: null, // SSH server hostname
98
+ port: 22, // SSH server port
99
+ username: null,
100
+ sshterm: 'xterm-color'
142
101
  },
143
102
  header: {
144
- text: null, // Custom header text
145
- background: 'green', // Header background color
146
- },
147
- autoConnect: false // Whether to connect automatically
148
- };
149
- ```
150
-
151
- ### Auto-Connect Functionality
152
-
153
- The `autoConnect` option is used to create pre-configured connections:
154
-
155
- - When set to `true`, the client will attempt to connect immediately using the provided SSH configuration, bypassing the login form.
156
- - For `autoConnect` to work, you must provide at least the `host` in the SSH configuration.
157
- - `autoConnect` requires a username and password. If these are not provided, the server may use other methods (like basic auth or session data) to authenticate the connection.
158
- - If the host is missing when `autoConnect` is `true,` the login form will be shown instead.
159
-
160
- Example usage:
161
-
162
- ```javascript
163
- window.webssh2Config = {
164
- ssh: {
165
- host: 'example.com',
166
- port: 22,
167
- username: 'user', // Optional
168
- password: 'password' // Optional
103
+ text: null,
104
+ background: 'green'
169
105
  },
170
- autoConnect: true
106
+ autoConnect: false
171
107
  };
172
108
  ```
173
109
 
174
- This configuration will attempt to connect to `example.com` as soon as the page loads, using any provided credentials or relying on server-side authentication methods.
175
-
176
- ### Security Considerations
177
-
178
- The `autoConnect` feature only requires the host to be specified. The server handles authentication, which may use various methods, including basic auth or session data.
179
- - If you do include a username and password in the client-side configuration, be cautious, as this may pose security risks, especially in production environments.
180
- - For production use, consider using secure server-side authentication methods rather than including credentials in the client-side configuration.
181
- When `autoConnect` is not used, ensure your server is configured to prompt for or securely handle credentials as needed.
182
-
183
- ### Customization Examples
184
-
185
- 1. Setting a custom header:
186
- ```javascript
187
- window.webssh2Config = {
188
- header: {
189
- text: 'My Custom SSH Client',
190
- background: '#007acc'
191
- }
192
- };
193
- ```
194
-
195
- 2. Configuring for a specific SSH server with auto-connect:
196
- ```javascript
197
- window.webssh2Config = {
198
- ssh: {
199
- host: 'myserver.example.com',
200
- port: 2222
201
- },
202
- autoConnect: true
203
- };
204
- ```
110
+ ## Development
205
111
 
206
- By leveraging these configuration options, you can customize the WebSSH2 client to suit your needs or integrate it seamlessly into your existing systems. Remember that the server handles authentication, providing flexibility in managing and securing credentials.
112
+ - For development information see [DEVELOPMENT.md](./DEVELOPMENT.md).
207
113
 
208
114
  ## Support
209
115
 
210
- If you find this project helpful, you can support the developer:
116
+ If you find this project helpful, consider supporting the developer:
211
117
 
212
118
  [![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/billchurch)
213
119
 
214
-
215
120
  ## License
216
121
 
217
122
  This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
218
123
 
219
124
  ## Acknowledgments
220
125
 
221
- - [Xterm.js](https://xtermjs.org/) for providing the terminal emulator
222
- - [Socket.IO](https://socket.io/) for real-time, bidirectional communication
223
- - [Webpack](https://webpack.js.org/) for module bundling
126
+ - [Xterm.js](https://xtermjs.org/) for terminal emulation
127
+ - [Socket.IO](https://socket.io/) for WebSocket communication
128
+ - [Webpack](https://webpack.js.org/) for module bundling
@@ -1,4 +1,4 @@
1
- <!-- Version Version 0.2.25 - 2024-08-22T17:16:39.057Z - 3bb6482 -->
1
+ <!-- Version Version 0.2.27 - 2024-12-02T21:03:28.371Z - 1989d45 -->
2
2
  <!-- webssh2-client -->
3
3
  <!-- /client/src/client.htm -->
4
4
  <!DOCTYPE html>
@@ -14,20 +14,44 @@
14
14
  <dialog id="loginDialog" class="modal">
15
15
  <div class="modal-content">
16
16
  <h2>WebSSH2 Login</h2>
17
- <form id="loginForm" class="pure-form pure-form-stacked">
18
- <fieldset>
19
- <input type="text" id="hostInput" placeholder="Hostname" required>
20
- <input type="text" id="portInput" placeholder="Port" required>
21
- <input type="text" id="usernameInput" placeholder="Username" required autocomplete="username">
22
- <div class="password-wrapper">
23
- <input type="password" id="passwordInput" placeholder="Password" required autocomplete="current-password">
24
- <i id="capsLockIcon" class="fas fa-circle-up fa-fw"></i>
25
- </div>
26
- <div class="login-buttons">
27
- <button type="submit" class="pure-button pure-button-primary">Connect</button>
28
- <button type="button" id="loginSettingsBtn" class="pure-button"><i class="fas fa-cog"></i></button>
17
+ <form id="loginForm" class="pure-form">
18
+ <input type="text" id="hostInput" name="host" placeholder="Host" required>
19
+ <input type="text" id="portInput" name="port" placeholder="Port" value="22">
20
+ <input type="text" id="usernameInput" name="username" placeholder="Username" required>
21
+
22
+ <!-- Password section - always visible -->
23
+ <div class="password-wrapper">
24
+ <input type="password" id="passwordInput" name="password" placeholder="Password">
25
+ <span id="capsLockIcon">⇪</span>
26
+ </div>
27
+
28
+ <!-- Private key toggle button -->
29
+ <div class="private-key-toggle">
30
+ <button type="button" id="privateKeyToggle" class="pure-button">
31
+ <i class="fa fa-key"></i> Add SSH Key
32
+ </button>
33
+ </div>
34
+
35
+ <!-- Private key section (initially hidden) -->
36
+ <div id="privateKeySection" class="hidden">
37
+ <div class="private-key-input">
38
+ <textarea id="privateKeyText" name="privateKey"
39
+ placeholder="Paste your private key here" rows="3"></textarea>
40
+ <div class="file-upload">
41
+ <input type="file" id="privateKeyFile" accept=".pem,.key">
42
+ <label for="privateKeyFile" class="pure-button">
43
+ <i class="fa fa-upload"></i> Upload Key File
44
+ </label>
45
+ </div>
46
+ <input type="password" id="passphraseInput" name="passphrase"
47
+ placeholder="Key password (if encrypted)" class="optional">
29
48
  </div>
30
- </fieldset>
49
+ </div>
50
+
51
+ <div class="login-buttons">
52
+ <button type="submit" class="pure-button pure-button-primary">Connect</button>
53
+ <button type="button" id="loginSettingsBtn" class="pure-button">⚙️</button>
54
+ </div>
31
55
  </form>
32
56
  </div>
33
57
  </dialog>