Contribute
Read this first
Where circumvention is illegal, contributing can put you at risk. You can contribute under a pseudonym, and the steps to do it safely are in Contribute safely. Do them before your first commit.
Setup
You need Go (the version in go.mod, currently go 1.27) and nothing else. The one third-party dependency, uTLS, is fetched by go build; adding another needs a written justification in its pull request, as uTLS has.
git clone https://github.com/we-apranik/apranik.git
cd Apranik
go build ./...
go test -race ./...Before sending a change, all of these must be clean:
gofmt -l . # prints nothing
go vet ./...
go test -race ./...A local end-to-end check
The example config file opens a SOCKS5 inbound on 127.0.0.1:1080 and an HTTP inbound on 127.0.0.1:1081, both leaving through freedom.
go build -o apranik ./cmd/apranik
./apranik check -config cmd/apranik/config.json
./apranik run -config cmd/apranik/config.json &
python3 -m http.server 8099 --bind 127.0.0.1 & # a local origin
curl -x socks5h://127.0.0.1:1080 http://127.0.0.1:8099/
curl -x http://127.0.0.1:1081 http://127.0.0.1:8099/To try an overlay, the guides have server and client files for Trojan over TLS, WebSocket and HTTPUpgrade; run both on one machine with the client's server set to 127.0.0.1 and a self-signed certificate in its certificate_authorities.
./apranik modules lists every module compiled into the build. Set the log level to debug in a copy of the config file to see handshakes, routing and sniff results.
How the code is organised
spec/: the contract. Changing it is a design decision; open an issue first.module/: one folder per transport, proxy protocol or sniffer.shared/: helper packages two or more modules need, one concept each.core/: everything that composes modules. Modules never import it.config/: the JSON config file.cmd/apranik/: the standalone command.
See Architecture for the full map.
Where to go next
- New here: your first module, a sniffer from empty folder to a working rule.
- Add a module: base stream transport, overlay transport, proxy protocol, sniffer, DNS server or API module.
- Tests and pull requests: what a change should contain, and the areas that need careful review.
- Practices and performance: how the code is written.
- Good first issues.
- Editing the docs.