ViRb3 / wgcf

🚤 Cross-platform, unofficial CLI for Cloudflare Warp
MIT License
6.1k stars 684 forks source link

Connection refused on Termux #169

Closed ViktorVoloshko closed 2 years ago

ViktorVoloshko commented 2 years ago

I'm using arm64 prebuilt binary in Termux and getting this: ~/wgcf $ ./wgcf_2.2.12_linux_arm64 register 2022/03/18 13:29:10 Using config file: wgcf-account.toml This project is in no way affiliated with Cloudflare Cloudflare's Terms of Service: https://www.cloudflare.com/application/terms/ ✔ Yes 2022/03/18 13:29:11 Post "https://api.cloudflareclient.com/v0a1922/reg": dial tcp: lookup api.cloudflareclient.com on [::1]:53: read udp [::1]:49078->[::1]:53: read: connection refused On my Windows laptop with same WiFi spot wgcf working properly. What possibly can be wrong?

ViRb3 commented 2 years ago

wgcf does not currently support Android. For a workaround that may or may not work, check: https://github.com/ViRb3/wgcf/issues/31#issuecomment-676764479

Otherwise, closing in favor of #79

ViktorVoloshko commented 2 years ago

Thanks for answer, I think my Google is broken cause I tried to search but found nothing. There is a working non-root solution for Termux by Saito.Alex from 4PDA. pkg upgrade pkg install proot-distro proot-distro install alpine proot-distro login alpine --termux-home apk -U upgrade And after all we can use wgcf as in any other GNU/Linux distro. Our Alpine and Termux filesystems will be merged so if we already have wgcf we don't need to download it. But in case you don't have it: mkdir wgcf cd wgcf wget LINK_FROM_GITHUB_HERE Let's say downloaded file named wgcf, actually it will be something like wgcf_2.12_linux_arm64 chmod u+x wgcf Now wgcf can be used as usual. After all simply use exit to quit Alpine. Also there some sense in doing termux-setup-storage to copy generated config to main memory for importing.

PoneyClairDeLune commented 1 year ago

wgcf does not currently support Android. For a workaround that may or may not work, check: #31 (comment)

Otherwise, closing in favor of #79

@ViRb3 Please just offer a way for users to define a custom DNS server. That will solve the problem without any further complications. It just makes no sense to pin on [::1]:53.

ViRb3 commented 1 year ago

@PoneyClairDeLune Unless I'm missing something, wgcf does not have any code that selects or pins the DNS server? It is all resolved via the OS. As far as I recall, this is a known issue where a binary compiled for Linux and then ran on Android has issues with the networking stack. Sure, we could add hacks to override that, but it would be better to just properly compile wgcf for Android instead. Happy to take PRs on that.

Stan-Di commented 10 months ago

Thanks for answer, I think my Google is broken cause I tried to search but found nothing. There is a working non-root solution for Termux by Saito.Alex from 4PDA. pkg upgrade pkg install proot-distro proot-distro install alpine proot-distro login alpine --termux-home apk -U upgrade And after all we can use wgcf as in any other GNU/Linux distro. Our Alpine and Termux filesystems will be merged so if we already have wgcf we don't need to download it. But in case you don't have it: mkdir wgcf cd wgcf wget LINK_FROM_GITHUB_HERE Let's say downloaded file named wgcf, actually it will be something like wgcf_2.12_linux_arm64 chmod u+x wgcf Now wgcf can be used as usual. After all simply use exit to quit Alpine. Also there some sense in doing termux-setup-storage to copy generated config to main memory for importing.

I solved this problem without installing proot in Termux:

pkg install golang
wget https://github.com/ViRb3/wgcf/archive/refs/tags/v2.2.19.tar.gz
tar xzf v2.2.19.tar.gz
cd wgcf-2.2.29
go build

After building in termux wgcf working fine!

img 2023-11-13 в 09 32 58_6766eb81