erebe / wstunnel

Tunnel all your traffic over Websocket or HTTP2 - Bypass firewalls/DPI - Static binary available
Other
3.22k stars 290 forks source link

Build wstunnel on ARM (e.g. Raspberry PI 3b+/4) #109

Closed vochong closed 7 months ago

vochong commented 2 years ago

Hello,

Could you please provide some instructions on how to build your wonderful wstunnel on ARM platforms (e.g. Raspberry PI 3b+/4).

Thanks a lot!

erebe commented 2 years ago

Hello, you can use this script to build on raspberry pi. https://github.com/erebe/wstunnel/blob/master/build_raspbian.sh

Haven't used it in a long time, so may need to update it

vochong commented 2 years ago

Hello, you can use this script to build on raspberry pi. https://github.com/erebe/wstunnel/blob/master/build_raspbian.sh

Haven't used it in a long time, so may need to update it

Thanks a lot. wstunnel is a very good and useful tool.

When you have time later, please enhance wstunnel with reverse tunnelling capability. Yes we can still do the reverse tunnelling trick by running an additional ssh reverse tunnelling session on the client, but it's a bit cumbersome. Having a built-in reverse tunnelling capability in wstunnel itself would make it even more awesome!

deyloTT commented 1 year ago

Hello, you can use this script to build on raspberry pi. https://github.com/erebe/wstunnel/blob/master/build_raspbian.sh

Haven't used it in a long time, so may need to update it

hey, is it available for termux? i have the other wstunnel from the npm and it runs without any error. is it possible that i can have your version working on my phone also? thanks for the great tool

Hello, you can use this script to build on raspberry pi. https://github.com/erebe/wstunnel/blob/master/build_raspbian.sh Haven't used it in a long time, so may need to update it

Thanks a lot. wstunnel is a very good and useful tool.

When you have time later, please enhance wstunnel with reverse tunnelling capability. Yes we can still do the reverse tunnelling trick by running an additional ssh reverse tunnelling session on the client, but it's a bit cumbersome. Having a built-in reverse tunnelling capability in wstunnel itself would make it even more awesome!

have you gotten the script to work on your device? i tried to run it on my phone but was unsuccessful :(

maurerr commented 1 year ago

here's the armhf built on debian10 https://www.dropbox.com/s/ofg34ir3a0n1fa8/wstunnel?dl=1 you might need libatomic1 and libffi if you don't have it and some symlinking ( sudo find /usr/lib -name "libffi.so*" ; sudo ln -s /usr/lib/arm-linux-gnueabihf/libffi.so.7 /usr/lib/arm-linux-gnueabihf/libffi.so.6 ) tested on dietpi and ubuntu22.10 on rpi4

erebe commented 1 year ago

Hello @maurerr

Thank you for the build, I am at the moment in vacation and will take a look at it at my return. In anycase, thank for sharing it :)

reyqn commented 1 year ago

Thanks, this is working well. Would love to see official builds if possible.

mghadam commented 12 months ago

I get the following error when building on debian 11 arm:

No setup information found for ghc-8.4.4 on your platform.
This probably means a GHC bindist has not yet been added for OS key 'linux-armv7', 'linux-armv7-ncurses6', 'linux-armv7-tinfo6'.
Supported versions: ghc-7.10.2, ghc-7.10.3, ghc-8.0.1, ghc-8.0.2, ghc-8.2.1, ghc-8.2.2, ghc-8.6.3, ghc-8.10.1, ghc-8.10.2, ghc-8.10.3, ghc-8.10.4, ghc-8.10.5, ghc-8.10.6, ghc-8.10.7, ghc-9.0.1
No setup information found for ghc-8.4.4 on your platform.
This probably means a GHC bindist has not yet been added for OS key 'linux-armv7', 'linux-armv7-ncurses6', 'linux-armv7-tinfo6'.
Supported versions: ghc-7.10.2, ghc-7.10.3, ghc-8.0.1, ghc-8.0.2, ghc-8.2.1, ghc-8.2.2, ghc-8.6.3, ghc-8.10.1, ghc-8.10.2, ghc-8.10.3, ghc-8.10.4, ghc-8.10.5, ghc-8.10.6, ghc-8.10.7, ghc-9.0.1
alexandervlpl commented 9 months ago

Has anybody been able to build a static arm binary that will just run on Termux, for example?

I started with build-aarch64.sh and compiled on Ubuntu aarch64 with dynamic linking, that works great. As soon as I add static options to wstunnel.cabal, the linker crashes with a million errors like:

/usr/lib/gcc/aarch64-linux-gnu/11/../../../aarch64-linux-gnu/libc.a(asprintf_chk.o):function __asprintf_chk: error: relocation overflow in R_AARCH64_LD64_GOTPAGE_LO15
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
TheFlyingRat commented 8 months ago

here's the armhf built on debian10 https://www.dropbox.com/s/ofg34ir3a0n1fa8/wstunnel?dl=1 you might need libatomic1 and libffi if you don't have it and some symlinking ( sudo find /usr/lib -name "libffi.so*" ; sudo ln -s /usr/lib/arm-linux-gnueabihf/libffi.so.7 /usr/lib/arm-linux-gnueabihf/libffi.so.6 ) tested on dietpi and ubuntu22.10 on rpi4

I'm trying to run your compiled binary on my GL.iNet router (OpenWrt) which runs BusyBox. I keep getting a -bash: /usr/bin/wstunnel: No such file or directory error. The executable does indeed live inside of /usr/bin. I'm not sure why it can't run.

This system is Armv7 and I don't believe any libraries are missing

Keep in mind, this system only has 128mb of internal flash thus compiling anything from source on this machine directly is impossible - and the package manager is opkg, which personally i've never heard of until I bought this router.

Are you able to advice on ways I could cross-compile on say a raspberry pi and then copy the built executable to this machine to run?

I appreciate your reply

maurerr commented 8 months ago

here's the armhf built on debian10 https://www.dropbox.com/s/ofg34ir3a0n1fa8/wstunnel?dl=1 you might need libatomic1 and libffi if you don't have it and some symlinking ( sudo find /usr/lib -name "libffi.so*" ; sudo ln -s /usr/lib/arm-linux-gnueabihf/libffi.so.7 /usr/lib/arm-linux-gnueabihf/libffi.so.6 ) tested on dietpi and ubuntu22.10 on rpi4

I'm trying to run your compiled binary on my GL.iNet router (OpenWrt) which runs BusyBox. I keep getting a -bash: /usr/bin/wstunnel: No such file or directory error. The executable does indeed live inside of /usr/bin. I'm not sure why it can't run.

This system is Armv7 and I don't believe any libraries are missing

Keep in mind, this system only has 128mb of internal flash thus compiling anything from source on this machine directly is impossible - and the package manager is opkg, which personally i've never heard of until I bought this router.

Are you able to advice on ways I could cross-compile on say a raspberry pi and then copy the built executable to this machine to run?

I appreciate your reply

I know openwrt (one of my favorites - see my forks) and opkg but compilation on it is not that easy as on a full fledged linux distro - you need to create a makefile like https://github.com/openwrt/packages/blob/master/net/dnscrypt-proxy2/Makefile then follow https://openwrt.org/docs/guide-developer/packages

TheFlyingRat commented 8 months ago

Good morning @maurerr, I appreciate your reply. I'll look into it when I get a chance probably tonight or tomorrow. I'll keep you updated since I'm bound to run into some issues 😂

Thanks, Rat

maurerr commented 8 months ago

Good morning @maurerr, I appreciate your reply. I'll look into it when I get a chance probably tonight or tomorrow. I'll keep you updated since I'm bound to run into some issues 😂

Thanks, Rat

let's continue any possible discussion on forum.openwrt.org - tag me - maurer there

erebe commented 7 months ago

You can take a look at the beta release 7.0.0 you have a version for armv7 (which works on pi)

https://github.com/erebe/wstunnel/releases/tag/v7.0-rc1

erebe commented 7 months ago

available in latest version

g0djira commented 2 months ago

~~Hello! I've got a problem when running a binary on Raspbian 11.8 Bullseye: "cannot execute binary file: Exec format error". Board model: Raspberry Pi 3 Model B Rev 1.2 Version downloaded: wstunnel_9.2.3_linux_armv7.tar.gz May be I'm doing something wrong? Thanks.~~

Sorry, gentlemen, my fault. I've accidentally mismatched usr/local and /usr/local/bin with different versions of executable.

struanb commented 2 months ago

That does suggest your Raspbian is not an arm/v7 Raspbian. Modern Pis can also run arm64 Raspbian/Debian.

What is output of uname -a and contents of /etc/os-release?

g0djira commented 2 months ago

uname -a Linux raspberrypi 6.1.21-v7+ #1642 SMP Mon Apr 3 17:20:52 BST 2023 armv7l GNU/Linux /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)" NAME="Raspbian GNU/Linux" VERSION_ID="11" VERSION="11 (bullseye)" VERSION_CODENAME=bullseye ID=raspbian ID_LIKE=debian