Warning
This repository serves as an educational demonstration on handling external binary files, along with fundamental Linux scripting techniques, network configuration setups, and routing integration within OpenWrt and FriendlyWrt environments. It provides practical examples to illustrate these concepts for learning and experimentation purposes. Please note that it is not designed or suitable for production use, as it may contain unoptimized code, potential security vulnerabilities, or incomplete features that could lead to instability in real-world applications. This project is created for scientific and technical purposes, aiming to advance knowledge in embedded systems and networking without any commercial intent. The author bears no responsibility for how the project is used, including any potential misuse, damages, or consequences arising from its application. Use it responsibly in controlled, non-critical settings only.
JustClash is a simple service package for OpenWrt that manages the Mihomo/Clash core in tproxy mode. The project showcases how to wrap, configure, and control external proxy binaries, automate Linux service management, and interact with network and routing components in a router environment.
- Launches and supervises the Mihomo/Clash core as a system service.
- Integration of external binaries with Linux shell scripting.
- Simplified network and routing configuration (tproxy, Mixed port, firewall, policy routing).
- Integrates with OpenWrt service management.
- All configuration is handled via UCI (
/etc/config/justclash). - LuCI web interface for controlling and monitoring the service.
- Diagnostic tools for DNS, ICMP, and routing.
- Safe config reset, backup, and restore functionality.
justclash/— Main service scripts, init.d, config templates, helpers.luci-app-justclash/— LuCI web interface for controlling and monitoring the service.Makefile— OpenWrt-compatible package build scripts.- Files for build systems, Docker, syntax checkers, git and related automation.
nftablescoreutils-base64jqcurlkmod-nft-tproxykmod-nf-tproxy
-
luci-base -
justclash -
Firmware:
- Requires OpenWrt 24+
- FriendlyWrt 20240115+ (untested).
- LuCI and the above dependencies should be available.
You can install JustClash with a single command using the provided install script:
sh <(wget -O - https://raw.githubusercontent.com/saltymonkey/justclash/refs/heads/main/service.sh)
This method will allow automatically download, execute the installation script and install justclash with minimal manual input, handling the setup for you.
Prebuilt packages are available in the Releases section of the repository. To install:
-
Download the latest
justclashandluci-app-justclashpackages for your architecture from the Releases page. -
Transfer the packages to your router.
-
Install them using:
-
For OpenWrt (ipk packages):
opkg install justclash_*.ipk luci-app-justclash_*.ipk luci-i18n-justclash-ru-*.ipk -
For OpenWrt (apk packages):
apk add --allow-untrusted justclash-*.apk luci-app-justclash-*.apk luci-i18n-justclash-ru-*.apk -
You can build the JustClash packages using the provided Dockerfiles (with OpenWRT SDK):
-
For OpenWrt (ipk packages):
docker build -t justclash-builder-ipk -f Dockerfile-ipk . -
For OpenWrt (apk packages):
docker build -t justclash-builder-apk -f Dockerfile-apk .
After the build, extract the resulting packages from the container and install as explained above.
You can build the JustClash packages using the provided Docker compose file (with OpenWRT SDK), output volume mount: /output:
- For OpenWrt (ipk packages):
docker compose -f 'Docker-compose.yml' up -d --build 'ipk-builder'
- For OpenWrt (apk packages):
docker compose -f 'Docker-compose.yml' up -d --build 'apk-builder'
-
Configure via LuCI: Services → JustClash.
-
Or edit
/etc/config/justclashdirectly (YAML editing is not supported). -
Start/stop/restart the service manually:
/etc/init.d/justclash start /etc/init.d/justclash stop /etc/init.d/justclash restartor
service justclash stop service justclash start service justclash restart -
Use diagnostic commands for DNS, ICMP, and routing tests and etc. Check command below for more information.
/usr/bin/justclash help
- TUN mode is not supported. Only tproxy mode is available.
- This is a demonstration of service integration, not a full-featured proxy solution.
- Use at your own risk; no production support.
GPL-2.0
Issues and feature requests are accepted via GitHub Issues.