
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
node-httpx
Advanced tools
Provides a TLS-agnostic HTTP server and eliminates the redundancy in providing both secure and insecure servers.
node-httpx provides a nodejs library for managing http and https server at the same time. It also provides http and https requests.
This module, httpx , is published under the MIT license. It was written by Nate Watson and Oluwafunmiwo Judah Sholola.
node-httpx was written in response to this change request: https://github.com/joyent/node/issues/8827
Navigate to the directory where the script is needed with "cd directory".
Run the following command:
npm install node-httpx
Make sure you have the right to make NPM installations. If you don't have them, get them.
Run the following command:
npm install -g node-httpx
Navigate to the directory node-httpx is installed in.
Run the following command:
node httpxTester.js
Read the printout. It should print out a massive webpage. If it does not, perform network diagnostics. If the network is working properly, file a bug on github for httpx.
Open a browser on the same machine. Navigate to "https://localhost" or "http://localhost". Both work. Ignore any security errors.
The page should load correctly, and the script should end. If one of these things fails to happen, check the network. If the network is working correctly, file a bug on github for httpx.
Assuming you have not reached the "file a bug on github" statements, the script is installed correctly. If you have reached one of those, try reinstalling.
var httpx = require("./httpx.js");
var fs = require("fs");
console.dir(httpx.STATUS_CODES);
var config = {};
config.key = fs.readFileSync("./pd69744_privatekey.pem");
config.cert = fs.readFileSync("./pd69744_cert.pem");
var testServer = httpx.createServer(config, function(req, res){
res.writeHead(200, {'Connection': 'close'});
res.write("Hello World! I provided this page with a single module that takes a single callback function, and works with both HTTP and HTTPS. But I don't get overtime, so screw you world!");
res.end();
testServer.close(function(){console.log("goodbye");});
});
testServer.listen();
var options = {};
options.hostname = "encrypted.google.com";
options.path = "/";
options.method = "get";
var googleRequest = httpx.request(options, function(res){
var answer = "";
res.on("data", function(d){
answer += d;
});
res.on("end", function(){
console.log(answer);
});
});
googleRequest.write("text");
googleRequest.end();
console.log("By some miracle, the script didn\'t crash");
Node-httpx provides http's status codes object:
console.dir(httpx.STATUS_CODES);
In addition to native request objects, node-httpx provides the request and get functions of the http and https modules.
Function | Treat As | Documentation |
---|---|---|
httpx.httpRequest | http.request | https://nodejs.org/api/http.html#http_http_request_options_callback |
httpx.httpGet | http.get | https://nodejs.org/api/http.html#http_http_get_options_callback |
httpx.httpsRequest | https.request | https://nodejs.org/api/https.html#https_https_request_options_callback |
httpx.httpsGet | https.get | https://nodejs.org/api/https.html#https_https_get_options_callback |
FAQs
Provides a TLS-agnostic HTTP server and eliminates the redundancy in providing both secure and insecure servers.
The npm package node-httpx receives a total of 0 weekly downloads. As such, node-httpx popularity was classified as not popular.
We found that node-httpx demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.