Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
chemicaljs
Advanced tools
Easily create your own web proxy with no experience required.
A simple example can be found in /example/
.
Create a new Node.js project and create a script file for the server.
Install Chemical npm install chemicaljs
.
Import ChemicalServer
and create a new server.
import { ChemicalServer } from "chemicaljs";
const chemical = new ChemicalServer();
You can pass options to disable proxy services and set the default service.
const chemical = new ChemicalServer({
default: "rammerhead",
uv: true,
scramjet: false,
rammerhead: true
});
chemical.app
which is an express app. You may need to import express for certain APIs.chemical.app.get("/", function(req, res){
res.send("Hello World");
});
chemical.server
and listen on a port of your choosing.chemical.server.listen(3000);
Below is an example of a simple backend. This example will setup Chemical and serve the "public" folder along with the index.html
file as /
and .html
files without the extension.
import { ChemicalServer } from "chemicaljs";
import express from "express";
const chemical = new ChemicalServer();
const port = process.env.PORT || 3000;
chemical.app.use(express.static("public", {
index: "index.html",
extensions: ["html"]
}));
chemical.server.listen(port, () => {
console.log(`Chemical demo listening on port ${port}`);
});
In your project create a folder to store your static assets. Create an index.html file which will be the homepage of your website.
<script src="/chemical.js"></script>
If you want to set the wisp server to an external server just change the wisp
attribute.
<script wisp="wss://wisp.mercurywork.shop" src="/chemical.js"></script>
window.chemicalEncode
.await window.chemicalEncode("https://example.com")
Optional: Change service to ultraviolet
, scramjet
, or rammerhead
. Defaults to uv
or server option.
await window.chemicalEncode("https://example.com", "rammerhead")
if (window.chemicalLoaded) {
//Chemical is loaded
}
window.addEventListener("chemicalLoaded", function(e) {
//Chemical has loaded
});
Below is a simple example of a simple input that redirects to the encoded URL when the user presses enter. It checks if there is any input and if Chemical has loaded before loading.
<h1>Chemical Example</h1>
<input id="search" placeholder="Enter URL">
<script src="/chemical.js"></script>
<script>
const search = document.getElementById("search");
search.addEventListener("keydown", async function (e) {
if (e.key == "Enter" && window.chemicalLoaded && e.target.value) {
window.location = await window.chemicalEncode(e.target.value)
}
})
</script>
Some features that may come in the future are:
Chemical Uses the MIT license.
FAQs
Easily create your own web proxy with no experience required.
The npm package chemicaljs receives a total of 139 weekly downloads. As such, chemicaljs popularity was classified as not popular.
We found that chemicaljs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.