Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile to android aarch64 #6

Open
ingnelson opened this issue Dec 28, 2022 · 7 comments
Open

Compile to android aarch64 #6

ingnelson opened this issue Dec 28, 2022 · 7 comments

Comments

@ingnelson
Copy link

Hello.
This look a great program, I would like to use it .
Could you tell me with command I have to use to compile it for android using the architecture aarch64 , please .

I am planning to use my android phone as a client using the the Termux terminal app on android .

Vps server:
Could you give me the command to download and run your program in my vps (1.2.3.4) on port 8080 or 443

Client (Termux terminal app):
Could you give me the command to connect it to my vps (1.2.3.4) on port 8080 or 443 and use local host (127.0.0.1) and local port 1080 ?
This way I can use a a app (tun2tap for android app) and access to internet with all my android apps.

Similar to this video :
https://youtu.be/Rb4OIXWrjNU

I will wait your answer

@lutfailham96
Copy link
Owner

lutfailham96 commented Dec 28, 2022

Hello. This look a great program, I would like to use it . Could you tell me with command I have to use to compile it for android using the architecture aarch64 , please .

I am planning to use my android phone as a client using the the Termux terminal app on android .

Vps server: Could you give me the command to download and run your program in my vps (1.2.3.4) on port 8080 or 443

Client (Termux terminal app): Could you give me the command to connect it to my vps (1.2.3.4) on port 8080 or 443 and use local host (127.0.0.1) and local port 1080 ? This way I can use a a app (tun2tap for android app) and access to internet with all my android apps.

Similar to this video : https://youtu.be/Rb4OIXWrjNU

I will wait your answer

Hi, glad to hear that you are interested in this project

Server Side

All you need to do is installing on Server first based on installation instruction, make sure you have sudo access, golang installed on system & open port as i list below

  • 80 tcp
  • 443 tcp
  • 8082 tcp (Optional: if you want to use direct Websocket tunnel to backend)
git clone https://github.com/lutfailham96/go-tcp-proxy-tunnel \
    && cd go-tcp-proxy-tunnel \
    && make build \
    && sudo make install

Make sure you have already running backend server, such as SSH (with password authentication option enabled) on local port: 22, then you can spin up the websocket proxy server & web server
Run on new terminal session

go-tcp-proxy-tunnel \
    -l 127.0.0.1:8082 \
    -r 127.0.0.1:22 \
    -sv \
    -lv 3

Run on new terminal session

sudo go-ws-web-server \
    -b '127.0.0.1:8082' \
    -t '127.0.0.1:433' \
    -sni "localhost" \
    -lv 3

The server setup is completed & running

Client Side (Android w/ Termux)

If you are using termux, make sure you have installed git, golang, ssh, ncat

pkg install git golang make

Then build the binary using build command same as on Server

git clone https://github.com/lutfailham96/go-tcp-proxy-tunnel \
    && cd go-tcp-proxy-tunnel \
    && make build

Run the client proxy (with custom SNI: google.com), make sure you update your_server_domain_or_ip with your server domain (This will be used by outbound payload replacer [host] & your_server_ip with your server IP (This will be used as remote proxy address)

./go-tcp-proxy-tunnel \
    -l 127.0.0.1:9999 \
    -r your_server_ip:443 \
    -s your_server_domain:443 \
    -tls \
    -dsr \
    -sni google.com \
    -op "GET wss://[sni] HTTP/1.1[crlf]Host: [host][crlf]Upgrade: websocket[crlf]Connection: Upgrade[crlf][crlf]"

Open new terminal session & try connecting to SSH tunnel server using proxy as user: myuser

ssh -o "ProxyCommand=ncat --proxy 127.0.0.1:9999 %h %p" -v4ND 1080 myuser@localhost

This will bring up ssh client & bind socks5 dynamic proxy on local port 1080 (Android), you can verify tunnel connection by doing curl request using this socks5 proxy

curl -x socks5://127.0.0.1 https://ipinfo.io

Finally, you can use it on tun2tap as usual

Note
Run command on the server side is not daemonized, you can wrap it on systemd unit / using screen to make it as daemon service

@ingnelson
Copy link
Author

If my vps ip is 1.2.3.4 .

on the server i have to install screen program , this way i can open a new terminal and run these commands :

go-tcp-proxy-tunnel \
   -l 1.2.3.4:8082 \
   -r 1.2.3.4:22 \
   -sv \
   -lv 3

and then in another screen terminal i use these :

sudo go-ws-web-server \
    -b '1.2.3.4:8082' \
    -t  '1.2.3.4:433' \
    -sni "localhost" \
    -lv 3

am i wrong ?

then on client :


./go-tcp-proxy-tunnel \
    -l 127.0.0.1:9999 \
    -r 1.2.3.4:443 \
    -s 1.2.3.4:443 \
    -tls \
    -dsr \
    -sni google.com \
    -op "GET wss://[sni] HTTP/1.1[crlf]Host: [host][crlf]Upgrade: websocket[crlf]Connection: Upgrade[crlf][crlf]"

i would like to know if it is ok .

@lutfailham96
Copy link
Owner

If my vps ip is 1.2.3.4 .

on the server i have to install screen program , this way i can open a new terminal and run these commands :

go-tcp-proxy-tunnel \
   -l 1.2.3.4:8082 \
   -r 1.2.3.4:22 \
   -sv \
   -lv 3

and then in another screen terminal i use these :

sudo go-ws-web-server \
    -b '1.2.3.4:8082' \
    -t  '1.2.3.4:433' \
    -sni "localhost" \
    -lv 3

am i wrong ?

then on client :


./go-tcp-proxy-tunnel \
    -l 127.0.0.1:9999 \
    -r 1.2.3.4:443 \
    -s 1.2.3.4:443 \
    -tls \
    -dsr \
    -sni google.com \
    -op "GET wss://[sni] HTTP/1.1[crlf]Host: [host][crlf]Upgrade: websocket[crlf]Connection: Upgrade[crlf][crlf]"

i would like to know if it is ok .

yes, correct. you can use that commands

@maleeqB
Copy link

maleeqB commented Feb 19, 2023

Good day, immediately after connecting to tun2tap or any other socks to vpn app, The ssh connection closes immediately

Connection to localhost closed by remote host.   
    
Transferred: sent 2372, received 2288 bytes, in 54.1 seconds 
                           
Bytes per second: sent 43.9, received 42.3                                            

debug1: Exit status -1

Every single time I connect a socks5 to vpn app

@maleeqB
Copy link

maleeqB commented Feb 19, 2023

nvm, the solution is to bypass the VPN for Termux, so that the connection won't reset

@ingnelson
Copy link
Author

@maleeqB what so you mean by " nvm " ? What commands do we need to use?

@maleeqB
Copy link

maleeqB commented Feb 24, 2023

I mean "never mind", I asked a question, and I found the solution

Regarding the commands, I used the commands he gave above and it works for ssl/tls tunnelling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants