[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-5608":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":39,"readmeContent":40,"aiSummary":41,"trendingCount":16,"starSnapshotCount":16,"syncStatus":42,"lastSyncTime":43,"discoverSource":44},5608,"wstunnel","erebe\u002Fwstunnel","erebe","Tunnel all your traffic over Websocket or HTTP2 - Bypass firewalls\u002FDPI - Static binary available ","",null,"Rust",6770,540,56,31,0,5,26,103,27,39.2,"BSD 3-Clause \"New\" or \"Revised\" License",false,"main",true,[27,28,29,30,31,32,33,34,35,36,37,38],"http2","reverse-tunnel","socks","socks5","socks5-proxy","tcp-tunnel","transparent-proxy","tunneling","udp-tunnel","websocket","wireguard","wireguard-tunnel","2026-06-12 02:01:12","\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Ferebe\u002Fwstunnel\u002Fraw\u002Fmain\u002Fdocs\u002Flogo_wstunnel.png\" alt=\"wstunnel logo\" height=\"400\"\u002F>\n\u003C\u002Fp>\n\n\u003Cp align=\"right\">\n  \u003Ca href=\"https:\u002F\u002Fko-fi.com\u002FP5P4QCHMO\">\u003Cimg src=\"https:\u002F\u002Fko-fi.com\u002Fimg\u002Fgithubbutton_sm.svg\"\u002F>\u003C\u002Fa>\n  \u003Cbr\u002F>\n\u003C\u002Fp>\n\n## Summary\n\n* [Description](#description)\n* [Demo server](#demo)\n* [Command line](#cmd)\n* [Examples](#examples)\n* [Release](#release)\n* [Note](#note)\n* [Benchmark](#bench)\n* [How to build](#build)\n\n## Description \u003Ca name=\"description\">\u003C\u002Fa>\n\nMost of the time when you are using a public network, you are behind some kind of firewall or proxy. One of their\npurpose is to constrain you to only use certain kind of protocols and consult only a subset of the web. Nowadays, the\nmost widespread protocol is http and is de facto allowed by third party equipment.\n\nWstunnel uses the websocket protocol which is compatible with http in order to bypass firewalls and proxies. Wstunnel\nallows you to tunnel whatever traffic you want and access whatever resources\u002Fsite you need.\n\nMy inspiration came from [this project](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fwstunnel) but as I don't want to install npm and\nnodejs to use this tool, I remade it in ~~Haskell~~ Rust and improved it.\n\n**What to expect:**\n\n* Easy to use\n* Good error messages and debug information\n* Static forward (reverse) tunneling (TCP, UDP, Unix socket, Stdio)\n* Dynamic (reverse) tunneling (Socks5 proxy, HTTP proxy and Transparent Proxy)\n* Support for using http proxy (when behind one) as gateway\n* Support of proxy protocol\n* Support for tls\u002Fhttps server with certificates auto-reload (with embedded self-signed certificate, or your own)\n* Support of mTLS with certificates auto-reload - [documentation here](https:\u002F\u002Fgithub.com\u002Ferebe\u002Fwstunnel\u002Fblob\u002Fmain\u002Fdocs\u002Fusing_mtls.md)\n* Support IPv6\n* Support for Websocket and HTTP2 as transport protocol (websocket is more performant)\n* **Standalone binaries** (so just cp it where you want) [here](https:\u002F\u002Fgithub.com\u002Ferebe\u002Fwstunnel\u002Freleases)\n\n## Sponsors \u003Ca name=\"sponsors\">\u003C\u002Fa>\n\nPart of Wstunnel development has been sponsored by\n\u003Cp align=\"center\">\n   \u003Ca href=\"https:\u002F\u002Fserviceplanet.nl\">\n    \u003Cimg width=\"200\" height=\"100\" src=\"https:\u002F\u002Fgithub.com\u002Ferebe\u002Fwstunnel\u002Fraw\u002Fmain\u002Fdocs\u002Flogo_serviceplanet.png\" alt=\"service planet logo\"\u002F>\n   \u003C\u002Fa>\u003C\u002Fp>\n\n## Note \u003Ca name=\"note\">\u003C\u002Fa>\n\nv7.0.0 is a complete rewrite of wstunnel in Rust and is not compatible with previous version.\nPrevious code in Haskell can be found on branch https:\u002F\u002Fgithub.com\u002Ferebe\u002Fwstunnel\u002Ftree\u002Fhaskell\n\nWhat to expect from previous version:\n\n* More throughput and less jitter due to Haskell GC. Most of you will not care, as it was performant enough already. But\n  you can now saturate a gigabit ethernet card with a single connection\n* Command line is more homogeneous\u002Fhas better UX. All tunnel can be specified multiple times\n* Tunnel protocol tries to look like normal traffic, to avoid being flagged\n* Support of reverse tunneling\n* New bug, it is a rewrite (╯'□')╯︵ ┻━┻ ¯\\\\_(ツ)_\u002F¯\n* Mainly for me to ease the maintenance of the project. I don't do a lot of haskell nowadays and it was harder for me to\n  keep maintening the project over time, as I get lost in touch of the Haskell ecosystem and new release.\n* Armv7 build (aka raspberry pi), as new version of GHC (Haskell compiler) dropped its support\n\n\n## Demo server \u003Ca name=\"demo\">\u003C\u002Fa>\n\nIf you just want to try out that you can bypass your proxy\u002Ffirewall.\nYou can give it a try with wstunnel demo server.\n\n```bash\n# In a terminal start wstunnel client\n# You can set as tls-sni-override whatever domain you want. The tunnel is the only one that is going to be allowed. \nwstunnel client -L 'tcp:\u002F\u002F4443:10.43.0.11:444' -P demo --tls-sni-override=google.fr wss:\u002F\u002F49.13.58.9\n\n# on another terminal, run curl and it should return you this greetings\ncurl -k https:\u002F\u002Flocalhost:4443\n> Memento mori !\n```\n\n\n## Command line \u003Ca name=\"cmd\">\u003C\u002Fa>\n\n```\nUsage: wstunnel client [OPTIONS] \u003Cws[s]|http[s]:\u002F\u002Fwstunnel.server.com[:port]>\n\nArguments:\n  \u003Cws[s]|http[s]:\u002F\u002Fwstunnel.server.com[:port]>\n          Address of the wstunnel server\n          You can either use websocket or http2 as transport protocol. Use websocket if you are unsure.\n          Example: For websocket with TLS wss:\u002F\u002Fwstunnel.example.com or without ws:\u002F\u002Fwstunnel.example.com\n                   For http2 with TLS https:\u002F\u002Fwstunnel.example.com or without http:\u002F\u002Fwstunnel.example.com\n          \n          *WARNING* HTTP2 as transport protocol is harder to make it works because:\n            - If you are behind a (reverse) proxy\u002FCDN they are going to buffer the whole request before forwarding it to the server\n              Obviously, this is not going to work for tunneling traffic\n            - if you have wstunnel behind a reverse proxy, most of them (i.e: nginx) are going to turn http2 request into http1\n              This is not going to work, because http1 does not support streaming naturally\n          The only way to make it works with http2 is to have wstunnel directly exposed to the internet without any reverse proxy in front of it\n\nOptions:\n  -L, --local-to-remote \u003C{tcp,udp,socks5,stdio,unix}:\u002F\u002F[BIND:]PORT:HOST:PORT>\n          Listen on local and forwards traffic from remote. Can be specified multiple times\n          examples:\n          'tcp:\u002F\u002F1212:google.com:443'      =>       listen locally on tcp on port 1212 and forward to google.com on port 443\n          'tcp:\u002F\u002F2:n.lan:4?proxy_protocol' =>       listen locally on tcp on port 2 and forward to n.lan on port 4\n                                                    Send a proxy protocol header v2 when establishing connection to n.lan\n          \n          'udp:\u002F\u002F1212:1.1.1.1:53'          =>       listen locally on udp on port 1212 and forward to cloudflare dns 1.1.1.1 on port 53\n          'udp:\u002F\u002F1212:1.1.1.1:53?timeout_sec=10'    timeout_sec on udp force close the tunnel after 10sec. Set it to 0 to disable the timeout [default: 30]\n          \n          'socks5:\u002F\u002F[::1]:1212'            =>       listen locally with socks5 on port 1212 and forward dynamically requested tunnel\n          'socks5:\u002F\u002F[::1]:1212?login=admin&password=admin' => listen locally with socks5 on port 1212 and only accept connection with login=admin and password=admin\n          \n          'http:\u002F\u002F[::1]:1212'              =>       start a http proxy on port 1212 and forward dynamically requested tunnel\n          'http:\u002F\u002F[::1]:1212?login=admin&password=admin' => start a http proxy on port 1212 and only accept connection with login=admin and password=admin\n\n          'tproxy+tcp:\u002F\u002F[::1]:1212'        =>       listen locally on tcp on port 1212 as a *transparent proxy* and forward dynamically requested tunnel\n          'tproxy+udp:\u002F\u002F[::1]:1212?timeout_sec=10'  listen locally on udp on port 1212 as a *transparent proxy* and forward dynamically requested tunnel\n                                                    linux only and requires sudo\u002FCAP_NET_ADMIN\n          \n          'stdio:\u002F\u002Fgoogle.com:443'         =>       listen for data from stdio, mainly for `ssh -o ProxyCommand=\"wstunnel client --log-lvl=off -L stdio:\u002F\u002F%h:%p ws:\u002F\u002Flocalhost:8080\" my-server`\n          \n          'unix:\u002F\u002F\u002Ftmp\u002Fwstunnel.sock:g.com:443' =>  listen for data from unix socket of path \u002Ftmp\u002Fwstunnel.sock and forward to g.com:443\n\n  -R, --remote-to-local \u003C{tcp,udp,socks5,unix}:\u002F\u002F[BIND:]PORT:HOST:PORT>\n          Listen on remote and forwards traffic from local. Can be specified multiple times. Only tcp is supported\n          examples:\n          'tcp:\u002F\u002F1212:google.com:443'      =>     listen on server for incoming tcp cnx on port 1212 and forward to google.com on port 443 from local machine\n          'udp:\u002F\u002F1212:1.1.1.1:53'          =>     listen on server for incoming udp on port 1212 and forward to cloudflare dns 1.1.1.1 on port 53 from local machine\n          'socks5:\u002F\u002F[::1]:1212'            =>     listen on server for incoming socks5 request on port 1212 and forward dynamically request from local machine\n          'http:\u002F\u002F[::1]:1212'              =>     listen on server for incoming http proxy request on port 1212 and forward dynamically request from local machine (login\u002Fpassword is supported)\n          'unix:\u002F\u002Fwstunnel.sock:g.com:443' =>     listen on server for incoming data from unix socket of path wstunnel.sock and forward to g.com:443 from local machine\n\n      --no-color \u003CNO_COLOR>\n          Disable color output in logs\n          \n          [env: NO_COLOR=]\n\n      --socket-so-mark \u003CINT>\n          (linux only) Mark network packet with SO_MARK sockoption with the specified value.\n          You need to use {root, sudo, capabilities} to run wstunnel when using this option\n\n  -c, --connection-min-idle \u003CINT>\n          Client will maintain a pool of open connection to the server, in order to speed up the connection process.\n          This option set the maximum number of connection that will be kept open.\n          This is useful if you plan to create\u002Fdestroy a lot of tunnel (i.e: with socks5 to navigate with a browser)\n          It will avoid the latency of doing tcp + tls handshake with the server\n          \n          [default: 0]\n\n      --nb-worker-threads \u003CINT>\n          *WARNING* The flag does nothing, you need to set the env variable *WARNING*\n          Control the number of threads that will be used.\n          By default, it is equal the number of cpus\n          \n          [env: TOKIO_WORKER_THREADS=]\n\n      --log-lvl \u003CLOG_LEVEL>\n          Control the log verbosity. i.e: TRACE, DEBUG, INFO, WARN, ERROR, OFF\n          for more details: https:\u002F\u002Fdocs.rs\u002Ftracing-subscriber\u002Flatest\u002Ftracing_subscriber\u002Ffilter\u002Fstruct.EnvFilter.html#example-syntax\n          \n          [env: RUST_LOG=]\n          [default: INFO]\n\n      --tls-sni-override \u003CDOMAIN_NAME>\n          Domain name that will be used as SNI during TLS handshake\n          Warning: If you are behind a CDN (i.e: Cloudflare) you must set this domain also in the http HOST header.\n                   or it will be flagged as fishy and your request rejected\n\n      --tls-sni-disable\n          Disable sending SNI during TLS handshake\n          Warning: Most reverse proxies rely on it\n\n      --tls-ech-enable\n          Enable ECH (encrypted sni) during TLS handshake to wstunnel server.\n          Warning: Ech DNS config is not refreshed over time. It is retrieved only once at startup of the program\n\n      --tls-verify-certificate\n          Enable TLS certificate verification.\n          Disabled by default. The client will happily connect to any server with self-signed certificate.\n\n  -p, --http-proxy \u003CUSER:PASS@HOST:PORT>\n          If set, will use this http proxy to connect to the server\n          \n          [env: HTTP_PROXY=]\n\n      --http-proxy-login \u003CLOGIN>\n          If set, will use this login to connect to the http proxy. Override the one from --http-proxy\n          \n          [env: WSTUNNEL_HTTP_PROXY_LOGIN=]\n\n      --http-proxy-password \u003CPASSWORD>\n          If set, will use this password to connect to the http proxy. Override the one from --http-proxy\n          \n          [env: WSTUNNEL_HTTP_PROXY_PASSWORD=]\n\n  -P, --http-upgrade-path-prefix \u003CHTTP_UPGRADE_PATH_PREFIX>\n          Use a specific prefix that will show up in the http path during the upgrade request.\n          Useful if you need to route requests server side but don't have vhosts\n          \n          [env: WSTUNNEL_HTTP_UPGRADE_PATH_PREFIX=]\n          [default: v1]\n\n      --http-upgrade-credentials \u003CUSER[:PASS]>\n          Pass authorization header with basic auth credentials during the upgrade request.\n          If you need more customization, you can use the http_headers option.\n\n      --websocket-ping-frequency-sec \u003Cseconds>\n          Frequency at which the client will send websocket ping to the server.\n          \n          [default: 30]\n\n      --websocket-mask-frame\n          Enable the masking of websocket frames. Default is false\n          Enable this option only if you use unsecure (non TLS) websocket server, and you see some issues. Otherwise, it is just overhead.\n\n  -H, --http-headers \u003CHEADER_NAME: HEADER_VALUE>\n          Send custom headers in the upgrade request\n          Can be specified multiple time\n\n      --http-headers-file \u003CFILE_PATH>\n          Send custom headers in the upgrade request reading them from a file.\n          It overrides http_headers specified from command line.\n          File is read everytime and file format must contain lines with `HEADER_NAME: HEADER_VALUE`\n\n      --tls-certificate \u003CFILE_PATH>\n          [Optional] Certificate (pem) to present to the server when connecting over TLS (HTTPS).\n          Used when the server requires clients to authenticate themselves with a certificate (i.e. mTLS).\n          The certificate will be automatically reloaded if it changes\n\n      --tls-private-key \u003CFILE_PATH>\n          [Optional] The private key for the corresponding certificate used with mTLS.\n          The certificate will be automatically reloaded if it changes\n\n      --dns-resolver \u003CDNS_RESOLVER>\n          Dns resolver to use to lookup ips of domain name. Can be specified multiple time\n          Example:\n           dns:\u002F\u002F1.1.1.1 for using udp\n           dns+https:\u002F\u002F1.1.1.1?sni=cloudflare-dns.com for using dns over HTTPS\n           dns+tls:\u002F\u002F8.8.8.8?sni=dns.google for using dns over TLS\n          For Dns over HTTPS\u002FTLS if an HTTP proxy is configured, it will be used also\n          To use libc resolver, use\n          system:\u002F\u002F0.0.0.0\n\n          **WARN** On windows you may want to specify explicitly the DNS resolver to avoid excessive DNS queries\n```\n\n```\nSERVER\nUsage: wstunnel server [OPTIONS] \u003Cws[s]:\u002F\u002F0.0.0.0[:port]>\n\nArguments:\n  \u003Cws[s]:\u002F\u002F0.0.0.0[:port]>\n          Address of the wstunnel server to bind to\n          Example: With TLS wss:\u002F\u002F0.0.0.0:8080 or without ws:\u002F\u002F[::]:8080\n          \n          The server is capable of detecting by itself if the request is websocket or http2. So you don't need to specify it.\n\nOptions:\n      --socket-so-mark \u003CINT>\n          (linux only) Mark network packet with SO_MARK sockoption with the specified value.\n          You need to use {root, sudo, capabilities} to run wstunnel when using this option\n\n      --websocket-ping-frequency-sec \u003Cseconds>\n          Frequency at which the server will send websocket ping to client.\n\n      --no-color \u003CNO_COLOR>\n          Disable color output in logs\n          \n          [env: NO_COLOR=]\n\n      --websocket-mask-frame\n          Enable the masking of websocket frames. Default is false\n          Enable this option only if you use unsecure (non TLS) websocket server, and you see some issues. Otherwise, it is just overhead.\n\n      --nb-worker-threads \u003CINT>\n          *WARNING* The flag does nothing, you need to set the env variable *WARNING*\n          Control the number of threads that will be used.\n          By default, it is equal the number of cpus\n          \n          [env: TOKIO_WORKER_THREADS=]\n\n      --restrict-to \u003CDEST:PORT>\n          Server will only accept connection from the specified tunnel information.\n          Can be specified multiple time\n          Example: --restrict-to \"google.com:443\" --restrict-to \"localhost:22\"\n\n      --dns-resolver \u003CDNS_RESOLVER>\n          Dns resolver to use to lookup ips of domain name\n          This option is not going to work if you use transparent proxy\n          Can be specified multiple time\n          Example:\n           dns:\u002F\u002F1.1.1.1 for using udp\n           dns+https:\u002F\u002F1.1.1.1?sni=loudflare-dns.com for using dns over HTTPS\n           dns+tls:\u002F\u002F8.8.8.8?sni=dns.google for using dns over TLS\n          To use libc resolver, use\n          system:\u002F\u002F0.0.0.0\n\n      --log-lvl \u003CLOG_LEVEL>\n          Control the log verbosity. i.e: TRACE, DEBUG, INFO, WARN, ERROR, OFF\n          for more details: https:\u002F\u002Fdocs.rs\u002Ftracing-subscriber\u002Flatest\u002Ftracing_subscriber\u002Ffilter\u002Fstruct.EnvFilter.html#example-syntax\n          \n          [env: RUST_LOG=]\n          [default: INFO]\n\n  -r, --restrict-http-upgrade-path-prefix \u003CRESTRICT_HTTP_UPGRADE_PATH_PREFIX>\n          Server will only accept connection from if this specific path prefix is used during websocket upgrade.\n          Useful if you specify in the client a custom path prefix, and you want the server to only allow this one.\n          The path prefix act as a secret to authenticate clients\n          Disabled by default. Accept all path prefix. Can be specified multiple time\n          \n          [env: WSTUNNEL_RESTRICT_HTTP_UPGRADE_PATH_PREFIX=]\n\n      --restrict-config \u003CRESTRICT_CONFIG>\n          Path to the location of the restriction yaml config file.\n          Restriction file is automatically reloaded if it changes\n\n      --tls-certificate \u003CFILE_PATH>\n          [Optional] Use custom certificate (pem) instead of the default embedded self-signed certificate.\n          The certificate will be automatically reloaded if it changes\n\n      --tls-private-key \u003CFILE_PATH>\n          [Optional] Use a custom tls key (pem, ec, rsa) that the server will use instead of the default embedded one\n          The private key will be automatically reloaded if it changes\n\n      --tls-client-ca-certs \u003CFILE_PATH>\n          [Optional] Enables mTLS (client authentication with certificate). Argument must be PEM file\n          containing one or more certificates of CA's of which the certificate of clients needs to be signed with.\n          The ca will be automatically reloaded if it changes\n          \n    -p, --http-proxy \u003CUSER:PASS@HOST:PORT>\n          If set, will use this http proxy to connect to the client\n\n          [env: HTTP_PROXY=]\n\n      --http-proxy-login \u003CLOGIN>\n          If set, will use this login to connect to the http proxy. Override the one from --http-proxy\n\n          [env: WSTUNNEL_HTTP_PROXY_LOGIN=]\n\n      --http-proxy-password \u003CPASSWORD>\n          If set, will use this password to connect to the http proxy. Override the one from --http-proxy\n\n          [env: WSTUNNEL_HTTP_PROXY_PASSWORD=]\n```\n\n## Release \u003Ca name=\"release\">\u003C\u002Fa>\n\nStatic binaries are available in [release section](https:\u002F\u002Fgithub.com\u002Ferebe\u002Fwstunnel\u002Freleases)\n\ndocker image are available at https:\u002F\u002Fgithub.com\u002Ferebe\u002Fwstunnel\u002Fpkgs\u002Fcontainer\u002Fwstunnel\n\n```bash\ndocker pull ghcr.io\u002Ferebe\u002Fwstunnel:latest\n```\n\n## Examples \u003Ca name=\"examples\">\u003C\u002Fa>\n\n* [Understand command line syntax](#syntax)\n* [Simplest one with socks5 - Good for browsing internet](#simple)\n* [Proxy SSH](#ssh)\n* [Bypass a corporate proxy](#corporate)\n* [Proxy Wireguard traffic](#wireguard)\n* [Android](#android)\n* [Proxy easily any traffic with transparent proxy (linux only)](#tproxy)\n* [Reverse tunneling](#reverse)\n* [How to secure access of your wstunnel server](#secure)\n* [Use HTTP2 instead of websocket for transport protocol](#http2)\n* [Maximize your stealthiness\u002FMake your traffic discrete](#stealth)\n\n### Understand command line syntax \u003Ca name=\"syntax\">\u003C\u002Fa>\n\nWstunnel command line mimic ssh tunnel syntax.\nYou can take reference to [this article](https:\u002F\u002Fiximiuz.com\u002Fen\u002Fposts\u002Fssh-tunnels\u002F), or this diagram to understand\n\u003Cimg src=\"https:\u002F\u002Fiximiuz.com\u002Fssh-tunnels\u002Fssh-tunnels.png\">\n\n---\n\n### Simplest one \u003Ca name=\"simple\">\u003C\u002Fa>\n\nOn your remote host, start the wstunnel's server by typing this command in your terminal\n\n```bash\nwstunnel server wss:\u002F\u002F[::]:8080\n```\n\nThis will create a websocket server listening on any interface on port 8080.\nOn the client side use this command to forward traffic through the websocket tunnel\n\n```bash\nwstunnel client -L socks5:\u002F\u002F127.0.0.1:8888 --connection-min-idle 5 wss:\u002F\u002FmyRemoteHost:8080\n```\n\nThis command will create a socks5 server listening on port 8888 of the loopback interface and will forward traffic\ndynamically.\n`connection-min-idle 10` is going an optimization to create a pool of 10 connection connected to the server, to speed-up\nthe establishement of new tunnels.\n\nWith firefox you can setup a proxy using this tunnel, by setting in networking preferences 127.0.0.1:8888 and selecting\nsocks5 proxy.\nBe sure to check the option `Proxy DNS when using SOCKS v5` for the server to resolve DNS name and not your local\nmachine.\n\nor with curl\n\n```bash\ncurl -x socks5h:\u002F\u002F127.0.0.1:8888 http:\u002F\u002Fgoogle.com\u002F\n#Please note h after the 5, it is to avoid curl resolving DNS name locally\n```\n\n---\n\n### As proxy command for SSH \u003Ca name=\"ssh\">\u003C\u002Fa>\n\nYou can specify `stdio` as source port on the client side if you wish to use wstunnel as part of a proxy command for ssh\n\n```bash\nssh -o ProxyCommand=\"wstunnel client --log-lvl=off -L stdio:\u002F\u002F%h:%p ws:\u002F\u002FmyRemoteHost:8080\" my-server\n```\n\n---\n\n### When behind a corporate proxy \u003Ca name=\"corporate\">\u003C\u002Fa>\n\nAn other useful example is when you want to bypass an http proxy (a corporate proxy for example)\nThe most reliable way to do it is to use wstunnel as described below\n\nStart your wstunnel server with tls activated\n\n```bash\nwstunnel server wss:\u002F\u002F[::]:443 --restrict-to 127.0.0.1:22\n```\n\nThe server will listen on any interface using port 443 (https) and restrict traffic to be forwarded only to the ssh\ndaemon.\n\n**Be aware that the server will use self signed certificate with weak cryptographic algorithm.\nIt was made in order to add the least possible overhead while still being compliant with tls.**\n\n**Do not rely on wstunnel to protect your privacy, if it is one of your concerns, you should only forwards traffic that\nis already secure by design (ie: https or vpn traffic)**\n\nNow on the client side start the client with\n\n```bash\nwstunnel client -L tcp:\u002F\u002F9999:127.0.0.1:22 -p http:\u002F\u002Fmycorporateproxy:8080 wss:\u002F\u002FmyRemoteHost:443\n```\n\nIt will start a tcp server on port 9999 that will contact the corporate proxy, negotiate a tls connection with the\nremote host and forward traffic to the ssh daemon on the remote host.\n\nYou may now access your server from your local machine on ssh by using\n\n```bash\nssh -p 9999 login@127.0.0.1\n```\n\n---\n\n### Wireguard and wstunnel \u003Ca name=\"wireguard\">\u003C\u002Fa>\n\nYou can find a full [tutorial](https:\u002F\u002Fcommunity.hetzner.com\u002Ftutorials\u002Fobfuscating-wireguard-using-wstunnel) that explain how to setup wstunnel and wireguard at [here](https:\u002F\u002Fcommunity.hetzner.com\u002Ftutorials\u002Fobfuscating-wireguard-using-wstunnel)\n\nFor a quick explanation see below.\n\nYou have a working wireguard client configuration called `wg0.conf`. Let's say\n\n```\n[Interface]\nAddress = 10.200.0.2\u002F32, fd00:cafe::2\u002F128\nPrivateKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=\n\n[Peer]\nPublicKey = 9iicV7Stdl\u002FU0RH1BNf3VvlVjaa4Eus6QPEfEz6cR0c=\nAllowedIPs = 0.0.0.0\u002F0, ::\u002F0\nEndpoint = my.server.com:51820\n```\n\nStart wstunnel server on my.server.com like this\n\n```\nwstunnel server --restrict-to localhost:51820 wss:\u002F\u002F[::]:443\n```\n\non your local machine start the client like this\n\n```\nwstunnel client -L 'udp:\u002F\u002F51820:localhost:51820?timeout_sec=0' wss:\u002F\u002Fmy.server.com:443\n```\n\nchange your wireguard client config to something\n\n```\n[Interface]\nAddress = 10.200.0.2\u002F32, fd00:cafe::2\u002F128\nPrivateKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=\n# Replace by a dns your server has access to\ndns = 8.8.8.8\n# https:\u002F\u002Fgithub.com\u002Fnitred\u002Fnr-wg-mtu-finder to find best mtu for you\nMTU = 1400 \n\n[Peer]\nPublicKey = 9iicV7Stdl\u002FU0RH1BNf3VvlVjaa4Eus6QPEfEz6cR0c=\nAllowedIPs = 0.0.0.0\u002F0, ::\u002F0\n# Should target port where wstunnel client is listenning to\nEndpoint = localhost:51820\n# Should not be necessary if you enable wstunnel client websocket ping\nPersistentKeepalive = 20\n```\n\nAdd a default route to your server, as your AllowedIps are catch-all, it is to avoid the traffic looping.\n\n```bash\nsudo ip route add ip.of.my.server.com dev eth0 via 192.168.0.1\n# replace eth0 (interface) and 192.168.0.1 (router gateway) by the one given by `ip route get ip.of.my.server.com` \n```\n\nstart your wireguard, and it should be working\n\n```\nsudo wg-quick up wg0\nping 10.200.0.1 # ping another ip of your vpn network\n```\n\nFAQ\n\n- Disable default udp tunnel timeout that will auto-close it after 30sec. `i.e: udp:\u002F\u002F1212:127.0.0.1:5201?timeout_sec=0`\n- If you see some throughput issue, be sure to lower the MTU of your wireguard interface (you can do it via config file)\n  to something like 1300 or you will endup fragmenting udp packet (due to overhead of other layer) which is always\n  causing issues\n- If wstunnel cannot connect to server while wireguard is on, be sure you have added a static route via your main\n  gateway for the ip of wstunnel server.\n  Else if you forward all the traffic without putting a static route, you will endup looping your traffic wireguard\n  interface -> wstunnel client -> wireguard interface\n- If you have trouble making it works on windows, please check this issue\n  https:\u002F\u002Fgithub.com\u002Ferebe\u002Fwstunnel\u002Fissues\u002F252\n\n---\n\n### Android \u003Ca name=\"android\">\u003C\u002Fa>\n\nYou can use the android binary and use termux to run it on your phone.\n\nIf you want a guide regarding how to use wstunnel on Android, you can follow this [guide](https:\u002F\u002Fcommunity.hetzner.com\u002Ftutorials\u002Fobfuscating-wireguard-using-wstunnel)\n\n---\n\n\n### Transparent proxy (linux only) \u003Ca name=\"tproxy\">\u003C\u002Fa>\n\nTransparent proxy allows to easily proxy any program.\nStart wstunnel with\n\n```\nsudo wstunnel client -L 'tproxy+tcp:\u002F\u002F1080' -L 'tproxy+udp:\u002F\u002F1080' wss:\u002F\u002Fmy.server.com:443\n```\n\nuse this project to route traffic seamlessly https:\u002F\u002Fgithub.com\u002FNOBLES5E\u002Fcproxy. It works with any program\n\n```\ncproxy --port 1080 --mode tproxy -- curl https:\u002F\u002Fgoogle.com\n```\n\nYou can even start a new shell, were all your commands will be proxyfied\n\n```\ncproxy --port 1080 --mode tproxy -- bash\n```\n\n---\n\n### Reverse tunneling \u003Ca name=\"reverse\">\u003C\u002Fa>\n\nStart wstunnel with\n\n```\nsudo wstunnel client -R 'tcp:\u002F\u002F[::]:8000:localhost:8000' wss:\u002F\u002Fmy.server.com:443\n```\n\nIn another terminal, start a simple webserver on your local machine\n\n```\npython3 -m http.server\n```\n\nFrom your my.server.com machine\u002Fnetwork you can now do\n\n```\ncurl http:\u002F\u002Flocalhost:8000\n```\n\n---\n\n### How to secure the access of your wstunnel server \u003Ca name=\"secure\">\u003C\u002Fa>\n\nGenerate a secret, let's say `h3GywpDrP6gJEdZ6xbJbZZVFmvFZDCa4KcRd`\n\nNow start you server with the following command\n\n```bash\nwstunnel server --restrict-http-upgrade-path-prefix h3GywpDrP6gJEdZ6xbJbZZVFmvFZDCa4KcRd  wss:\u002F\u002F[::]:443 \n```\n\nAnd start your client with\n\n```bash\nwstunnel client --http-upgrade-path-prefix h3GywpDrP6gJEdZ6xbJbZZVFmvFZDCa4KcRd ... wss:\u002F\u002FmyRemoteHost\n```\n\nNow your wstunnel server, will only accept connection if the client specify the correct path prefix during the upgrade\nrequest.\n\nIf you need more customization, you can use a config file to specify specific rules with `--restrict-config`.\nYou can find examples of restriction rules [there](https:\u002F\u002Fgithub.com\u002Ferebe\u002Fwstunnel\u002Fblob\u002Fmain\u002Frestrictions.yaml)\n\n---\n\n### Use HTTP2 instead of websocket for the transport protocol \u003Ca name=\"http2\">\u003C\u002Fa>\n\nUse this only if websocket is blocked by your firewall\u002Fproxy. Otherwise, it is less performant than websocket.\n\nStart your wstunnel server as usual with\n\n```bash\nwstunnel server wss:\u002F\u002F[::]:8080\n```\n\nOn the client the only difference is to specify https:\u002F\u002F instead of wss:\u002F\u002F\n\n```bash\nwstunnel client -L socks5:\u002F\u002F127.0.0.1:8888 https:\u002F\u002FmyRemoteHost:8080\n```\n\n**WARNING** HTTP2 as transport protocol is harder to make it works because:\n\n- If you are behind a (reverse) proxy\u002FCDN they may buffer the whole request before forwarding it to the server.\n  Cloudflare is doing that, and obviously, this is not going to work for tunneling traffic\n- if you have wstunnel behind a reverse proxy, most of them (i.e: nginx) are going to turn http2 request into http1\n  This is not going to work, because http1 does not support streaming naturally\n\nThe only way to make it works with HTTP2 is to have wstunnel server directly exposed to the internet without any reverse\nproxy in front of it\n\nIn addition, you may also want to play with the request headers (i.e: content-length and content-type) to make it looks\nlike normal traffic to bypass your firewall\u002Fproxy.\nSome firewall may not like to see request with content-length not set, or with content-type set to\napplication\u002Foctet-stream\n\n### Maximize your stealthiness\u002FMake your traffic discrete \u003Ca name=\"stealth\">\u003C\u002Fa>\n\n* Use wstunnel with TLS activated (wss:\u002F\u002F) and use your own certificate\n    * Embedded certificate is self-signed and are the same for everyone, so can be easily fingerprinted\u002Fflagged\n    * Use valid certificate (i.e: with Let's Encrypt), self-signed certificate are suspicious\n* Use a custom http path prefix (see `--http-upgrade-path-prefix` option)\n    * To avoid having the same url than every other wstunnel user\n* Change your tls-sni-override to a domain is known to be allowed (i.e: google.com, baidu.com, etc...)\n    * this will not work if your wstunnel server is behind a reverse proxy (i.e: Nginx, Cloudflare, HAProxy, ...)\n\n## Benchmark \u003Ca name=\"bench\">\u003C\u002Fa>\n\n![image](https:\u002F\u002Fgithub.com\u002Ferebe\u002Fwstunnel\u002Fassets\u002F854278\u002F6e3580b0-c4f8-449e-881e-64d1df56b0ce)\n\n## How to Build \u003Ca name=\"build\">\u003C\u002Fa>\n\nInstall the Rust https:\u002F\u002Fwww.rust-lang.org\u002Ftools\u002Finstall or if you are a believer\n\n```\ncurl --proto '=https' --tlsv1.2 -sSf https:\u002F\u002Fsh.rustup.rs | sh\n``` \n\nand run those commands at the root of the project\n\n```\ncargo build --package wstunnel-cli\ntarget\u002Fdebug\u002Fwstunnel ...\n```\n","wstunnel 是一个基于 Websocket 或 HTTP2 协议的隧道工具，用于绕过防火墙和深度包检测。其核心功能包括静态和动态（反向）隧道支持，涵盖 TCP、UDP、Unix 套接字等多种协议，并且能够作为 Socks5 代理或透明代理使用。此外，wstunnel 支持通过 TLS\u002FHTTPS 服务器进行安全通信，具备证书自动重载功能，同时兼容 IPv6 网络环境。该工具特别适合于需要在受限网络环境下访问特定资源或服务的场景，如企业内网穿透、远程开发调试等。由于采用 Rust 语言开发，wstunnel 提供了高性能与低延迟的特性，且提供独立可执行文件，便于部署使用。",2,"2026-06-11 03:04:19","top_language"]