Installations
npm install ssh-http-agent
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
9.3.0
NPM Version
5.6.0
Score
68
Supply Chain
96.9
Quality
75.4
Maintenance
50
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
jpillora
Download Statistics
Total Downloads
2,486
Last Day
1
Last Week
15
Last Month
25
Last Year
154
GitHub Statistics
7 Stars
11 Commits
2 Forks
3 Watching
1 Branches
1 Contributors
Bundle Size
228.12 kB
Minified
61.11 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.1.7
Package Id
ssh-http-agent@0.1.7
Size
4.57 kB
NPM Version
5.6.0
Node Version
9.3.0
Total Downloads
Cumulative downloads
Total Downloads
2,486
Last day
0%
1
Compared to previous day
Last week
87.5%
15
Compared to previous week
Last month
733.3%
25
Compared to previous month
Last year
-25.2%
154
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
ssh-http-agent
An HTTP Agent for tunneling through SSH
Install
npm install --save ssh-http-agent
Features
- Simple
- Single ssh client can make multiple requests
Usage
Simple tunnel via 1.2.3.4
:
1const sshAgent = require("ssh-http-agent"); 2const http = require("http"); 3 4http.get( 5 { 6 agent: sshAgent.http({ 7 host: "1.2.3.4", 8 port: 22, 9 username: "root", 10 password: "supersecret" 11 }), 12 host: "echo.jpillora.com", 13 path: "/foo/bar" 14 }, 15 res => { 16 console.log(res.headers); 17 } 18);
Nested tunnels:
1const sshAgent = require("ssh-http-agent"); 2const http = require("http"); 3 4http.get( 5 { 6 agent: sshAgent.http([ 7 { 8 host: "first.hop.com", 9 username: "root", 10 password: "supersecret" 11 }, 12 { 13 host: "second.hop.com", 14 username: "root", 15 password: "supersecret" 16 } 17 ]), 18 host: "third.hop.com", 19 path: "/foo/bar" 20 }, 21 res => { 22 console.log(res.headers); 23 } 24);
With request
:
1const sshAgent = require("ssh-http-agent"); 2const request = require("request"); 3 4request.get( 5 "http://echo.jpillora.com/foo/bar", 6 { 7 agent: sshAgent.http({ 8 host: "1.2.3.4", 9 username: "root", 10 password: "supersecret" 11 }) 12 }, 13 (err, res, body) => { 14 console.log(err || body); 15 } 16);
API
Create an agent with:
sshAgent(httpAgent, sshConfig, opts)
sshAgent.http(sshConfig, opts)
sshAgent.https(sshConfig, opts)
Where:
httpAgent
is an instance ofhttp.Agent
orhttps.Agent
sshConfig
is one or manyssh2
client configuration objects(https://github.com/mscdex/ssh2#client-methods)opts
is an object with:debug
is aboolean
which enabled debug printingdisconnectDelay
is anumber
representing milliseconds to wait before closing idle ssh connections, by default its set to 0ms, so as soon as the last request completes, the parent ssh connection will be closed.
Notes
- Requires Node 8+
MIT License
Copyright © 2017 Jaime Pillora <dev@jpillora.com>
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.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
2 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-652h-xwhf-q4h6
Reason
Found 0/11 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
2.3
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More