A Rust-based application with a user interface for Windows that allows users to block specific websites.
- Add websites to a block list
- Remove websites from the block list
- Toggle blocking on and off
- Set timed blocks for websites
- Persistent storage of blocked sites
- Automatic blocking of common domain variants (www, m, app)
- Hosts file backup before modifications
- Language: Rust
- UI Library: Iced
- Blocking Mechanism: Modifies the Windows hosts file
- File Path:
C:\Windows\System32\drivers\etc\hosts
- iced = "0.10"
- serde = { version = "1.0", features = ["derive"] }
- serde_json = "1.0"
- url = "2.4"
- chrono = "0.4.39"
- Run the application with administrator privileges
- Enter a website URL in the input field
- Optionally, specify a block duration (e.g., 1s, 1m, 1h, 1d)
- Click "Add Website" to block the site
- Use the "Enable Blocking" / "Disable Blocking" button to toggle the blocker
- Ensure you have Rust installed on your system
- Clone this repository
- Run
cargo build --releasein the project directory - The executable will be available in
target/release/webblocker.exe - If you don't have Rust installed or prefer not to install it, a release build is included in the repository.
- The application requires administrator privileges to modify the hosts file
- A backup of the hosts file is created before any modifications
- Blocked websites are saved to a JSON file for persistence across app restarts
- it is advised to first select disble blocking then removing the sites.
- hence user is advised to resart the app once for unblocking to take affect
To install Rust, follow these steps:
Rust uses rustup for installation and version management. Run the following command in your terminal:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- run the .exe file as adminsitrator
- it should look something like this.
-
follow the steps in order RED YELLOW GREEN
-
CHECK!! , if does not work , close and restart your browser and/or perform the following code on terminal (admin)
ipconfig /flushdns
-
TO DELETE
-
IT IS ABSOLUTELY NECESSARY TO CLOSE AND RESTART THE SCRIPT IN ORDER FOR UNBLOCKING TO TAKE AFFECT !!!
-
- CHECK!! , if does not work , close and restart your browser and/or perform the following code on terminal (admin)
ipconfig /flushdns



