Proxy UDP over WebSocket - useful to use WireGuard in restricted networks.
  • Rust 85.9%
  • Nix 11.2%
  • Dockerfile 2.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-03-20 10:13:39 +01:00
.github Bump docker/build-push-action from 5 to 6 (#160) 2024-11-22 13:06:53 +01:00
nixos-modules nix: add missing default 2025-03-20 10:13:39 +01:00
zia-client misc: update deps 2025-02-02 17:27:14 +01:00
zia-common misc: update deps 2025-02-02 17:27:14 +01:00
zia-server misc: update deps 2025-02-02 17:27:14 +01:00
.editorconfig Rewrite (#105) 2023-11-17 13:57:39 +01:00
.gitignore added flake 2023-11-26 17:41:30 +01:00
.rustfmt.toml Initial Commit 2022-05-27 11:11:57 +02:00
Cargo.lock misc: update deps 2025-02-02 17:27:14 +01:00
Cargo.toml Rewrite (#105) 2023-11-17 13:57:39 +01:00
config.toml Added http proxy support 2022-07-18 16:49:12 +02:00
Dockerfile Allow reusing of UdpSockets (#19) 2022-07-28 18:20:32 +02:00
Dockerfile.gh-actions Improved websocket stack and ci (#14) 2022-07-23 17:55:21 +02:00
flake.lock misc: update deps 2025-01-22 10:35:30 +01:00
flake.nix nix: update to nixos-24.11 2024-11-22 13:02:03 +01:00
LICENSE Added deb file generation 2022-08-11 14:09:24 +02:00
package.nix nix: refactor package 2024-11-15 13:15:02 +01:00
README.md misc: update readme 2025-01-22 10:42:11 +01:00

Zia

Proxy UDP over WebSocket - useful to use WireGuard in restricted networks.

Basic example:

graph LR
    WC[Wireguard Client] ---|UDP| B[Zia Client]
    B ---|Websocket| C[Zia Server]
    C ---|UDP| D[Wireguard Server]

The benefit is that WebSocket uses HTTP. If you are on a restricted network where you can only access external services using a provided HTTP proxy, you can proxy your WireGuard UDP traffic over WebSocket through that proxy.

graph LR
    WC[Wireguard Client] ---|UDP| B[Zia Client]
    B ---|Websocket| C[Http Proxy]
    C ---|Websocket| D[Zia Server]
    D ---|UDP| E[Wireguard Server]

Mode

Name Description
WebSocket The UDP datagrams are wrapped inside WebSocket frames. These frames are then transmitted to the server, where they are unwrapped.
TCP The UDP datagrams are prefixed with a 16 bit length of the datagram and then transmitted to the server in TCP packages. At the server, these packages are unwrapped and forwarded to the actual UDP upstream.

The client is capable of doing a TLSv2 or TLSv3 handshake, the server isn't able to handle TLS requests. In a case where an end-to-end (zia-client <-> zia-server) TLS encryption should happen, you have to proxy the traffic for the server using a reverse proxy.

Client

Just download the appropriate binary from the latest release, or use the Docker image:

ghcr.io/marcelcoding/zia-client

Environment variables:

ZIA_LISTEN_ADDR=127.0.0.1:8080 # local udp listener
ZIA_UPSTREAM=ws://domain.tld:1234 # your zia server instance (ws(s) or tcp(s))
# ZIA_PROXY=http://user:pass@proxy.tld:8080 # optional http(s) proxy
# ZIA_COUNT=4 # count of websocket connecttions that should be used, useful if traffic is limited per proxy connection
# ZIA_WS_MASKING=1 # enable to conform with websocket spec, disabled by default to process data in zero-copy fashion 

If you are using the binary use --help to the all available options.

Server

Just download the appropriate binary from the latest release, or use the Docker image:

ghcr.io/marcelcoding/zia-server

Environment variables:

ZIA_LISTEN_ADDR=0.0.0.0:1234 # public websocket listener (client -> ZIA_UPSTREAM)
ZIA_UPSTREAM=domain.tld:9999 # your actual udp service e.g. wireguard listener
ZIA_MODE=WS # WS or TCP see client -> ZIA_UPSTREAM

If you are using the binary use --help to the all available options.