I was trying to find out a way to install tor meek on OpenWRT. Can someone tell me how to cross compile the meek client with OpenWRT?
Meek is written in Go. It has pretty reasonable cross-platform compilation options (compared to some languages).
First, you don't only cross-compile based on the operating system, you cross-compile based on the architecture and operating system. You need to know what architecture your OpenWRT router is running on. Go supports quite a wide variety of options and since Golang 1.5 cross-compiling has been a lot easier.
Choices for $GOOS are darwin (Mac OS X 10.7 and above and iOS), dragonfly, freebsd, linux, netbsd, openbsd, plan9, solaris and windows. Choices for $GOARCH are amd64 (64-bit x86, the most mature port), 386 (32-bit x86), arm (32-bit ARM), arm64 (64-bit ARM), ppc64le (PowerPC 64-bit, little-endian), ppc64 (PowerPC 64-bit, big-endian), mips64le (MIPS 64-bit, little-endian), and mips64 (MIPS 64-bit, big-endian).
Then, to build a copy of the
meek-client, lets say for Linux on ARM64 you'd run a series of commands like:
export GOPATH=`mktemp -d` export GOARCH=arm64 export GOOS=linux go get -u git.torproject.org/pluggable-transports/meek.git/meek-client
and this should result in a copy of
meek-client built for linux on arm64 in the
$ file $GOPATH/bin/linux_arm64/meek-client /tmp/tmp.kovJoNMmiL/bin/linux_arm64/meek-client: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, not stripped
Then your OpenWRT's Tor then needs to be configured to use meek, assuming you installed the
meek-client you built before at
/usr/local/bin/meek-client and you wanted to use the google domain front you'd add some lines to your torrc like these
ClientTransportPlugin meek exec /usr/local/bin/meek-client --url=https://meek-reflect.appspot.com/ --front=https://www.google.com/ UseBridges 1 Bridge meek 0.0.2.0:1