Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1d4b6f0

Browse files
committed
Added ssh connection configuration (#11)
1 parent513936b commit1d4b6f0

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

‎README.md‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Start from application menu.
3838

3939
If you want to change this behavior, you can add this to your`src/server/config.js` file in the OS.js distribution:
4040

41-
```
41+
```javascript
4242
{
4343
xterm: {
4444
// You can also set this as a string to force a username
@@ -47,6 +47,22 @@ If you want to change this behavior, you can add this to your `src/server/config
4747
}
4848
```
4949

50+
You can also change the connection arguments:
51+
52+
```javascript
53+
{
54+
xterm: {
55+
ssh: {
56+
// Custom hostname
57+
hostname:'localhost',
58+
59+
// Custom port
60+
args:'-p 1022'
61+
}
62+
}
63+
}
64+
```
65+
5066
##Contribution
5167

5268
***Become a[Patreon](https://www.patreon.com/user?u=2978551&ty=h&u=2978551)**

‎server.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,12 @@ let terminals = [];
4040
*/
4141
constcreateTerminal=(core,ws,options={},args=[])=>{
4242
constuseLogin=core.config('xterm.login',true);
43+
consthostname=core.config('xterm.ssh.hostname','localhost');
44+
constextraArguments=core.config('xterm.ssh.args','');
45+
4346
if(useLogin){
4447
constusername=typeofuseLogin==='string' ?useLogin :options.username;
45-
args=[...args,'-c',`ssh${username}@localhost`];
48+
args=[...args,'-c',`ssh${extraArguments}${username}@${hostname}`];
4649
}
4750

4851
console.log('[Xterm]','Creating terminal...',{useLogin, options, args});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp