Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chemicaljs

Package Overview
Dependencies
Maintainers
0
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chemicaljs - npm Package Compare versions

Comparing version 2.0.2 to 2.1.0

rammerhead.tgz

83

index.js

@@ -22,8 +22,3 @@ import { resolve, dirname } from "node:path";

import { meteorPath } from "meteorproxy";
import {
createRammerhead,
shouldRouteRh,
routeRhUpgrade,
routeRhRequest,
} from "@rubynetwork/rammerhead";
import createRammerhead from "rammerhead/src/server/index.js";
const __dirname = dirname(fileURLToPath(import.meta.url));

@@ -72,5 +67,33 @@

serveChemical = () => {
const rh = createRammerhead({
logLevel: "error",
});
const rh = createRammerhead();
const rammerheadScopes = [
"/rammerhead.js",
"/hammerhead.js",
"/transport-worker.js",
"/task.js",
"/iframe-task.js",
"/worker-hammerhead.js",
"/messaging",
"/sessionexists",
"/deletesession",
"/newsession",
"/editsession",
"/needpassword",
"/syncLocalStorage",
"/api/shuffleDict",
];
const rammerheadSession = /^\/[a-z0-9]{32}/;
const shouldRouteRh = (req) => {
const url = new URL(req.url, "http://0.0.0.0");
return (
rammerheadScopes.includes(url.pathname) ||
rammerheadSession.test(url.pathname)
);
};
const routeRhRequest = (req, res) => {
rh.emit("request", req, res);
};
const routeRhUpgrade = (req, socket, head) => {
rh.emit("upgrade", req, socket, head);
};

@@ -174,3 +197,3 @@ this.app.get("/chemical.js", async (req, res) => {

if (this.options.rammerhead && shouldRouteRh(req)) {
routeRhRequest(rh, req, res);
routeRhRequest(req, res);
} else {

@@ -189,3 +212,3 @@ this.app(req, res);

} else if (this.options.rammerhead && shouldRouteRh(req)) {
routeRhUpgrade(rh, req, socket, head);
routeRhUpgrade(req, socket, head);
} else {

@@ -233,5 +256,33 @@ socket.end();

const rh = createRammerhead({
logLevel: "error",
});
const rh = createRammerhead();
const rammerheadScopes = [
"/rammerhead.js",
"/hammerhead.js",
"/transport-worker.js",
"/task.js",
"/iframe-task.js",
"/worker-hammerhead.js",
"/messaging",
"/sessionexists",
"/deletesession",
"/newsession",
"/editsession",
"/needpassword",
"/syncLocalStorage",
"/api/shuffleDict",
];
const rammerheadSession = /^\/[a-z0-9]{32}/;
const shouldRouteRh = (req) => {
const url = new URL(req.url, "http://0.0.0.0");
return (
rammerheadScopes.includes(url.pathname) ||
rammerheadSession.test(url.pathname)
);
};
const routeRhRequest = (req, res) => {
rh.emit("request", req, res);
};
const routeRhUpgrade = (req, socket, head) => {
rh.emit("upgrade", req, socket, head);
};

@@ -333,3 +384,3 @@ const app = express();

if (options.rammerhead && shouldRouteRh(req)) {
routeRhRequest(rh, req, res);
routeRhRequest(req, res);
} else {

@@ -355,3 +406,3 @@ next();

} else if (options.rammerhead && shouldRouteRh(req)) {
routeRhUpgrade(rh, req, socket, head);
routeRhUpgrade(req, socket, head);
} else {

@@ -358,0 +409,0 @@ for (const upgrader of upgraders) {

56

package.json
{
"name": "chemicaljs",
"version": "2.0.2",
"description": "Easily create your own web proxy with no experience required.",
"repository": {
"type": "git",
"url": "git+https://github.com/chemicaljs/chemical.git"
},
"main": "index.js",
"type": "module",
"author": "Nebelung",
"license": "AGPL-3.0-only",
"scripts": {
"update": "npx npm-check-updates -u && npm i"
},
"dependencies": {
"@mercuryworkshop/bare-mux": "^2.0.9",
"@mercuryworkshop/epoxy-transport": "^2.1.13",
"@mercuryworkshop/libcurl-transport": "^1.3.10",
"@mercuryworkshop/scramjet": "^1.0.2",
"@mercuryworkshop/wisp-js": "^0.3.2",
"@rubynetwork/rammerhead": "^1.3.5",
"@titaniumnetwork-dev/ultraviolet": "^3.2.7",
"express": "^4.21.0",
"meteorproxy": "^1.0.6-patch.1"
},
"engines": {
"node": ">=20.11.0"
}
"name": "chemicaljs",
"version": "2.1.0",
"description": "Easily create your own web proxy with no experience required.",
"repository": {
"type": "git",
"url": "git+https://github.com/chemicaljs/chemical.git"
},
"main": "index.js",
"type": "module",
"author": "Nebelung",
"license": "AGPL-3.0-only",
"scripts": {
"update": "npx npm-check-updates -u && npm i"
},
"dependencies": {
"@mercuryworkshop/bare-mux": "^2.1.2",
"@mercuryworkshop/epoxy-transport": "^2.1.17",
"@mercuryworkshop/libcurl-transport": "^1.3.10",
"@mercuryworkshop/scramjet": "^1.0.2",
"@mercuryworkshop/wisp-js": "^0.3.2",
"@titaniumnetwork-dev/ultraviolet": "^3.2.7",
"express": "^4.21.1",
"meteorproxy": "^1.0.6-patch.1",
"rammerhead": "https://github.com/chemicaljs/chemical/raw/main/rammerhead.tgz"
},
"engines": {
"node": ">=20.11.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc