Browse Source

add ip of client to host login

pull/126/head
butlerx 8 years ago
parent
commit
17691412a7
No known key found for this signature in database GPG Key ID: B37CA765BAA89170
  1. 51
      public/.eslintrc
  2. 4
      wetty.js

51
public/.eslintrc

@ -1,51 +0,0 @@
{
"extends": "standard",
"env": {
"es6": true,
"jest": true,
"browser": true
},
"globals": {
"GENTLY": true,
"chrome": true,
"hterm" : true,
"lib" : true,
"io" : true
},
"rules": {
"no-multi-spaces": 0,
"comma-dangle": [
"error",
"always-multiline"
],
"key-spacing": [
"error",
{
"multiLine": {
"beforeColon": false,
"afterColon": true
},
"align": {
"beforeColon": false,
"afterColon": true,
"on": "colon",
"mode": "strict"
}
}
],
"semi": [
"error",
"always"
],
"no-var": [
"error"
],
"prefer-const": [
"error",
{
"destructuring": "any",
"ignoreReadBeforeAssign": false
}
]
}
}

4
wetty.js

@ -48,7 +48,9 @@ export default (port, globalsshuser, sshhost, sshport, sshauth, sslopts) => {
const ssh = match ? `${match[0].split('/ssh/').pop()}@${sshhost}` : sshAddress;
const cmd = process.getuid() === 0 && sshhost === 'localhost' ? '/bin/login' : './bin/ssh';
const args =
cmd === './bin/ssh' ? [ssh, '-p', sshport, '-o', `PreferredAuthentications=${sshauth}`] : [];
cmd === './bin/ssh'
? [ssh, '-p', sshport, '-o', `PreferredAuthentications=${sshauth}`]
: ['-h', socket.client.conn.remoteAddress.split(':')[3]];
const term = pty.spawn(cmd, args, {
name: 'xterm-256color',
cols: 80,

Loading…
Cancel
Save