{"size": 588, "ext": "js", "max_stars_repo_path": "bin/ttyx-server.js", "max_stars_repo_name": "risacher/tty.js", "max_stars_repo_stars_event_min_datetime": "2017-02-07T17:24:37.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-11T07:31:58.000Z", "max_issues_repo_path": "bin/ttyx-server.js", "max_issues_repo_name": "risacher/tty.js", "max_issues_repo_issues_event_min_datetime": "2018-02-22T11:32:01.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-18T23:04:34.000Z", "max_forks_repo_path": "bin/ttyx-server.js", "max_forks_repo_name": "risacher/tty.js", "max_forks_repo_forks_event_min_datetime": "2017-03-26T17:42:30.000Z", "max_forks_repo_forks_event_max_datetime": "2021-10-18T08:27:24.000Z"}
{"max_stars_count": 50, "max_issues_count": 14, "max_forks_count": 16, "avg_line_length": 22.6153846154, "max_line_length": 73, "alphanum_fraction": 0.6479591837}
#!/usr/bin/env node

/**
 * ttyx-server.js
 * Copyright (c) 2016, Dan Risacher (MIT License)
 * Copyright (c) 2012-2014, Christopher Jeffrey (MIT License)
 */

process.title = 'ttyx';

var ttyx = require('../');

var conf = ttyx.config.readConfig()

conf.shellArgs = function(session) {
    console.log ('session id', session.id);
//    console.log ('session headers:', session.req.headers);
    var xff = session.req.headers['x-forwarded-for'] || "no xff header";
    return [session.id, xff]; //session.req.headers['x-args'].split(' ');
};


var app = ttyx.Server(conf);

app.listen();
