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

[FEATURE] - wstunnel support #256

Open
satmandu opened this issue Jul 7, 2024 · 7 comments
Open

[FEATURE] - wstunnel support #256

satmandu opened this issue Jul 7, 2024 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@satmandu
Copy link

satmandu commented Jul 7, 2024

Is your feature request related to a problem? Please describe.
Tunneling through websockets using https://github.com/erebe/wstunnel would help in bypassing port based blocking.
Using wstunnel with wireguard currently requires a complicated configuration with 3 apps working together, when ideally the wireguard app would perhaps just include the wstunnel binary and have an exposed configuration interface to use it.

Describe the solution you'd like
wstunnel included with wgtunnel, with a built-in socks client to make use of it.

Describe alternatives you've considered
The alternative is currently hairy.

@satmandu satmandu added the enhancement New feature or request label Jul 7, 2024
@vincent1890
Copy link

😍😍😍😍😍❤❤❤❤❤❤❤

@zaneschepke
Copy link
Owner

Thank you for the feature request. I'll look into this!

@deyloTT
Copy link

deyloTT commented Jul 16, 2024

Is your feature request related to a problem? Please describe. Tunneling through websockets using https://github.com/erebe/wstunnel would help in bypassing port based blocking. Using wstunnel with wireguard currently requires a complicated configuration with 3 apps working together, when ideally the wireguard app would perhaps just include the wstunnel binary and have an exposed configuration interface to use it.

Describe the solution you'd like wstunnel included with wgtunnel, with a built-in socks client to make use of it.

Describe alternatives you've considered The alternative is currently hairy.

Hahaha i literally just came to post this exact thing. The link you provided for the configuration, is that how you currently achieve it with wgtunnel? I am going to try it out.

@satmandu
Copy link
Author

The info I have on making this work currently is in this thread: erebe/wstunnel#292

@deyloTT
Copy link

deyloTT commented Jul 16, 2024

The info I have on making this work currently is in this thread: erebe/wstunnel#292

Thanks, I just checked it out. Hopefully wgtunnel implements this into the app.

So currently for it to work on your phone, you have to issue the following command in termux?

.\wstunnel client -c 10 -L 'udp://51820:localhost:51820?timeout_sec=0' wss://vpn.server.com:443 --tls-sni-override vpn.server.com

@deyloTT
Copy link

deyloTT commented Aug 1, 2024

Hey, any update for websocket and SNI/bughost support in WGtunnel? I'm willing to be a tester also.

@bobpaul
Copy link

bobpaul commented Oct 25, 2024

wstunnel included with wgtunnel, with a built-in socks client to make use of it.

I use a different tool for wrapping wireguard (and amnezia) in websockets, but there should not be any need for socks5. It should be something like this:

flowchart TD
    web@{ shape: braces, label: "Web" }
    android{{Android apps}} --> WGTunnel
    WGTunnel --udp localhost:12345--> wsclient
    wsclient --udp encapsulate in websockets--> wsserver
    wsserver --udp wireguard.example.com:51820--> wireguard
    wireguard --normal--> web
    subgraph termux
      wsclient(wstunnel)
    end
    subgraph relay.example.com
      wsserver(wstunnel)
    end
    subgraph wireguard.example.com
       wireguard
    end
Loading

Where:

  • wireguard.example.com is your wireguard "server" that provides access to the internet
  • relay.example.com is the computer running the wstunnel server (could on the same computer as the wireguard server)

I think the wstunnel commands would be (for unencrypted websockets):

server

# start a tunnel server accepting websockets connections on 8080
# only allow outbound traffic to your wireguard server
$ wstunnel server ws://0.0.0.0:8080 --restrict-to wireguard.example.com:51820

in termux

# 
# 
$ wstunnel client -L'udp://12345:wireguard.example.com:51820?timeouts_sec=0', ws://relay.example.com:8080

In WGTunnel

  • Set the tunnel too tunnel all apps except termux
  • Change the Peer Endpoint from wireguard.example.com:51820 to localhost:12345

You can use Termux:Boot to start the wstunnel on bootup or Termux:Widget to put a "wstunnel" button on the home screen.


Maybe the best solution is to allow a user to start/kill a process in termux whenever a tunnel is started/stopped. Normal wireguard on Linux, etc has a PreUp= and PreDown= option. WG Tunnel could do something similar to get this issue as well as #408 and any future obfuscation methods as well.

This describes how programs like WGTunnel can run commands in termux.

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

No branches or pull requests

5 participants