Skip to content

Commit

Permalink
Added license file, console notificaiton on server start and backage.…
Browse files Browse the repository at this point in the history
…json update.
  • Loading branch information
rabchev committed Apr 8, 2013
1 parent ca85058 commit c9a3dbf
Showing 3 changed files with 50 additions and 6 deletions.
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
(MIT License)

Copyright (c) 2013 Boyan Rabchev <boyan@rabchev.com>. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16 changes: 13 additions & 3 deletions lib/terminal.js
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ var io = require("socket.io"),
path = require("path"),
fs = require("fs"),
repl = require("repl"),
util = require("util"),
streams = require("./streams"),
config = pkg.config || {},
standalone,
@@ -28,6 +29,8 @@ function redirect(res, url) {
function initialize(server, options, fn) {
"use strict";

var port, sPort, protocol;

if ("function" === typeof options) {
fn = options;
options = {};
@@ -47,16 +50,23 @@ function initialize(server, options, fn) {

if ("number" === typeof server) {
// if a port number is passed
var port = server;
port = server;

if (options && options.key) {
http = require("https");
protocol = "https";
http = require(protocol);
sPort = (port !== 443) ? ":" + port : "";
} else {
http = require("http");
protocol = "http";
http = require(protocol);
sPort = (port !== 80) ? ":" + port : "";
}

server = http.createServer(options);
server.listen(port, fn);
standalone = true;

console.log(util.format("Web-Terminal running at %s://localhost%s/terminal", protocol, sPort));
}

if (options) {
18 changes: 15 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "web-terminal",
"description": "Web-Terminal is a terminal server that provides remote CLI via standard web browser and HTTP protocol.",
"version": "0.6.1",
"version": "0.6.2",
"author": "Boyan Rabchev <boyan@rabchev.com>",
"contributors": [
{ "name": "Boyan Rabchev", "email": "boyan@rabchev.com" }
@@ -14,7 +14,10 @@
"cert": "",
"pfx": ""
},
"repository": "https://github.com/rabchev/web-terminal.git",
"repository": {
"type": "git",
"url": "https://github.com/rabchev/web-terminal.git"
},
"main": "index",
"preferGlobal": "false",
"dependencies": {
@@ -44,7 +47,16 @@
"web-terminal": "./bin/run.js"
},
"scripts": {
"start": "node ./bin/run.js"
"start": "node ./bin/run.js",
"test": "node test"
},
"bugs": {
"email": "boyan@rabchev.com",
"url": "https://github.com/rabchev/web-terminal/issues"
},
"license": {
"type": "MIT",
"url": "http://github.com/rabchev/web-terminal/blob/master/LICENSE"
},
"engines": { "node": ">=0.10" }
}

0 comments on commit c9a3dbf

Please sign in to comment.