To avoid supply chain attacks, please consider not updating the packages in this repository. All current dependencies have been checked for their specific versions.
A censorship-resistant web application that uses blockchain technology and IPFS to dynamically route users to the correct endpoint, even if traditional DNS or domain services are blocked or compromised.
curl https://raw.githubusercontent.com/SystemVll/censorless-web-router/refs/heads/main/auto-setup.sh > setup.sh && chmod +x setup.sh && ./setup.sh
The Censorless Web Router consists of two main components:
- Smart Contract ⛓️ - A contract deployed on the Optimism blockchain that stores the current valid endpoint URL
- Web Router 🔄 - A simple web application that queries the blockchain and redirects users to the current endpoint
When censorship occurs, the website owner can update the endpoint in the blockchain, and all users visiting the router will be automatically redirected to the new location.
-
Deploy the smart contract:
cd hardhat bun install bun run test # Run tests to ensure everything is working bun run deploy
-
Configure the router:
cd ../router bun install # Set contract address in .env echo "VITE_CONTRACT_ADDRESS=YOUR_CONTRACT_ADDRESS" > .env
-
Deploy the router:
bun run build # Deploy dist folder to any static hosting service (We highly recommend using IPFS)
- Deploy the Censorless contract once
- Update the endpoint URL whenever your site is censored:
await censorlessContract.methods.setEndpoint("https://new-domain.com").send({from: ownerAddress});
- Bookmark the router URL
- When the main site becomes inaccessible, visit the router
- You'll be automatically redirected to the current working endpoint
- Blockchain: Optimism (Layer 2 Ethereum solution)
- Smart Contract: Solidity 0.8.28
- Frontend: Vanilla TypeScript with Web3.js
- Connection: WebSocket connection to Optimism public node
- Requires the router to be accessible
- Relies on blockchain availability
- Small delay during redirection process