Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A piece of middleware for node-http-proxy that allows you to modify the remote service response with trumpet
A middleware component for node-http-proxy using trumpet to parse and transform the response from the proxied server.
$ npm install harmon
In this example the HTML below is returned from the remote server and parsed:
<html>
<head></head>
<body>
<div class="a">Nodejitsu Http Proxy</div>
<div class="b">& Frames</div>
</body>
</html>
The following line is removed:
<div class="b">& Frames</div>
And is replaced with:
<div>+ Trumpet</div>
from your project root:
$ cd node_modules/harmon/examples
$ node simple.js
Browse to localhost:8000 and you should see:
var http = require('http'),
connect = require('connect'),
httpProxy = require('http-proxy');
var selects = [];
var simpleselect = {};
simpleselect.query = '.b';
simpleselect.func = function (node) {
node.createWriteStream().end('<div>+ Trumpet</div>');
}
selects.push(simpleselect);
//
// Basic Connect App
//
var app = connect();
var proxy = httpProxy.createProxyServer({
target: 'http://localhost:9000'
})
//Additional true parameter can be used to ignore js and css files.
//app.use(require('../')([], selects, true));
app.use(require('../')([], selects));
app.use(function (req, res) {
proxy.web(req, res);
});
http.createServer(app).listen(8000);
http.createServer(function (req, res) {
res.writeHead(200, { 'Content-Type': 'text/html' });
res.write('<html><head></head><body><div class="a">Nodejitsu Http Proxy</div><div class="b">& Frames</div></body></html>');
res.end();
}).listen(9000);
or See how images could be rotated.
$ cd node_modules/harmon/examples
$ node rotate.js
See trumpet for the types of queries and functions you can use.
FAQs
A piece of middleware for node-http-proxy that allows you to modify the remote service response with trumpet
The npm package harmon receives a total of 684 weekly downloads. As such, harmon popularity was classified as not popular.
We found that harmon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.