strong-tunnel
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -0,1 +1,9 @@ | ||
2015-09-16, Version 1.1.3 | ||
========================= | ||
* test: generate cobertura coverage reports (Ryan Graham) | ||
* test: make example and test-example separate (Ryan Graham) | ||
2015-06-03, Version 1.1.2 | ||
@@ -2,0 +10,0 @@ ========================= |
{ | ||
"name": "strong-tunnel", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Semi-transparent wrapper for arbitrary network connections over ssh2", | ||
@@ -9,3 +9,3 @@ "main": "index.js", | ||
"pretest": "eslint . && jscs .", | ||
"test": "tap test/test-*.js" | ||
"test": "tap --coverage --coverage-report=cobertura test/test-*.js" | ||
}, | ||
@@ -34,3 +34,3 @@ "repository": { | ||
"jscs": "^1.11.3", | ||
"tap": "^0.6.0" | ||
"tap": "^1.3.2" | ||
}, | ||
@@ -37,0 +37,0 @@ "dependencies": { |
@@ -1,44 +0,11 @@ | ||
var fmt = require('util').format; | ||
var http = require('http'); | ||
var st = require('../'); | ||
var fork = require('child_process').fork; | ||
var tap = require('tap'); | ||
var server = http.createServer(function(req, res) { | ||
res.end(JSON.stringify(req.headers)); | ||
}); | ||
var sshOpts = { | ||
host: '127.0.0.1', | ||
}; | ||
server.listen(3030, function() { | ||
var direct = 'http://127.0.0.1:3030/'; | ||
var tunneled = 'http+ssh://127.0.0.1:3030/'; | ||
// Standard request using URL string | ||
http.get(direct, resLog('%s using %s:', direct, direct)); | ||
// URL is only modified if a tunnelling URL was given | ||
st(direct, function(err, url) { | ||
if (err) throw err; | ||
// url == direct, unmodified | ||
http.get(url, resLog('%s using %s:', direct, url)); | ||
tap.test('example script runs', function(t) { | ||
var example = fork(require.resolve('./example')); | ||
example.on('exit', function(code, signal) { | ||
t.assert(!code, 'exit 0'); | ||
t.assert(!signal, 'not signalled to exit'); | ||
t.end(); | ||
}); | ||
// optional second argument containing ssh config | ||
st(tunneled, sshOpts, function(err, url) { | ||
if (err) throw err; | ||
// url != tunneled, is modified | ||
http.get(url, resLog('%s using %s:', tunneled, url)); | ||
}); | ||
server.unref(); | ||
}); | ||
function resLog(prefix) { | ||
prefix = fmt.apply(null, arguments); | ||
return function onResponse(res) { | ||
res.on('data', function(d) { | ||
console.log('%s -> %s', prefix, d); | ||
}); | ||
}; | ||
} |
Sorry, the diff of this file is not supported yet
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
33150
16
237