Skip to content

Commit

Permalink
web telnet proxy implemented, almost working
Browse files Browse the repository at this point in the history
  • Loading branch information
Liming Xie committed Feb 23, 2016
1 parent 09464da commit 28b3c29
Show file tree
Hide file tree
Showing 16 changed files with 11,733 additions and 238 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Expand Up @@ -4,4 +4,7 @@
.idea
*.iml
*.log
log
node_modules
dist
tmp
data
Empty file added README.md
Empty file.
237 changes: 0 additions & 237 deletions index.html

This file was deleted.

43 changes: 43 additions & 0 deletions package.json
@@ -0,0 +1,43 @@
{
"name": "webtelnet",
"version": "0.1.0",
"description": "web to telnet bridge/proxy, enable playing MUD game with broswer",
"main": "./src/webtelnet.js",
"bin": {
"webtelnet": "./src/main.js"
},
"scripts": {
"start": "node ./src/main.js",
"debug": "node --debug ./src/main.js",
"clean": "rm -rf dist",
"test": "for i in $(ls src/tests/); do node \"src/tests/${i}\" | faucet ; done",
"validate": "npm run lint; npm run test && npm outdated --depth 0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/mudchina/webtelnet.git"
},
"keywords": [
"telnet",
"webtelnet",
"mud",
"webmud"
],
"author": "Raymond Xie",
"license": "MIT",
"bugs": {
"url": "https://github.com/mudchina/webtelnet/issues"
},
"homepage": "https://github.com/mudchina/webtelnet#README.md",
"dependencies": {
"express": "^4.13.4",
"minimist": "^1.2.0",
"mixin-pro": "^0.6.6",
"socket.io": "^1.4.4",
"underscore": "^1.8.3"
},
"devDependencies": {
"faucet": "0.0.1",
"tape": "^4.4.0"
}
}
28 changes: 28 additions & 0 deletions src/main.js
@@ -0,0 +1,28 @@
#!/usr/bin/env node

'use strict';

var conf = {
telnet: {
host: '127.0.0.1',
port: 4000,
},
web: {
host: '0.0.0.0',
port: 8000,
},
www: __dirname + '/../www',
logTraffic: true,
};

var args = require('minimist')(process.argv.slice(2));

if(args.p) conf.web.port = args.p;
if(args.h) conf.web.host = args.h;

if(args.mp) conf.telnet.port = args.mp;
if(args.mh) conf.telnet.host = args.mh;

var WebTelnetProxy = require('./webtelnet.js');

WebTelnetProxy.startProxy(conf);

0 comments on commit 28b3c29

Please sign in to comment.