Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f0145b9
Bump golang.org/x/net from 0.33.0 to 0.38.0
dependabot[bot] Oct 18, 2025
88b7398
Add dependabot.yml
jve-engineering Oct 18, 2025
3dd1c49
Bump actions/setup-go from 5 to 6
dependabot[bot] Oct 18, 2025
cc3efd4
Bump golang from 1.21 to 1.25
dependabot[bot] Oct 18, 2025
0953cac
Merge pull request #1 from jve-engineering/dependabot/go_modules/gola…
jve-engineering Oct 18, 2025
5efa6e4
Bump suah.dev/protect from 1.2.3 to 1.2.4
dependabot[bot] Oct 18, 2025
10fa301
Merge pull request #6 from jve-engineering/dependabot/go_modules/suah…
jve-engineering Oct 18, 2025
1550c22
Merge pull request #11 from jve-engineering/dependabot/docker/golang-…
jve-engineering Oct 18, 2025
4e3b31a
Bump golang.org/x/net from 0.33.0 to 0.46.0
dependabot[bot] Oct 18, 2025
59af3d5
Merge pull request #8 from jve-engineering/dependabot/go_modules/gola…
jve-engineering Oct 18, 2025
6d763a4
Bump github.com/things-go/go-socks5 from 0.0.5 to 0.1.0
dependabot[bot] Oct 18, 2025
1277452
Merge pull request #10 from jve-engineering/dependabot/go_modules/git…
jve-engineering Oct 18, 2025
5a32652
Merge pull request #4 from jve-engineering/dependabot/github_actions/…
jve-engineering Oct 18, 2025
c2d05a2
bump go to v1.25
jve-engineering Oct 18, 2025
4bfc9b1
bump go to v1.25
jve-engineering Oct 18, 2025
b09b00e
Merge pull request #12 from jve-engineering/bump_ci_go
jve-engineering Oct 18, 2025
5e55d13
bump to psx v1.2.76 & go-landlock v0.0.0-20250303204525
jve-engineering Oct 18, 2025
7dbf68c
psx v1.2.70
jve-engineering Oct 19, 2025
3fb344c
Merge pull request #13 from jve-engineering/bump_go-landlock_&_psx
jve-engineering Oct 19, 2025
25c9222
go fmt & goimports
jve-engineering Nov 20, 2025
71536f1
Merge pull request #18 from jve-engineering/clean_formating
jve-engineering Nov 20, 2025
a8a84df
Log level made configurable
jve-engineering Nov 20, 2025
c497964
Merge pull request #19 from jve-engineering/logging
jve-engineering Nov 20, 2025
85ace7d
Bump golang.org/x/crypto in the go_modules group across 1 directory
dependabot[bot] Nov 20, 2025
d5d776c
Merge pull request #17 from jve-engineering/dependabot/go_modules/go_…
jve-engineering Nov 20, 2025
1deb3dd
Bump golang.org/x/net from 0.47.0 to 0.48.0
dependabot[bot] Dec 9, 2025
f1def06
Merge pull request #20 from jve-engineering/dependabot/go_modules/gol…
jve-engineering Dec 19, 2025
6c02ffe
Bump docker/setup-buildx-action from 3.0.0 to 4.4.1
dependabot[bot] Nov 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# `dependabot.yml` file

# Enable version updates for golang
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"

# Enable version updates for Docker
- package-ecosystem: "docker"
# Look for a `Dockerfile` in the `root` directory
directory: "/"
# Check for updates once a week
schedule:
interval: "weekly"

# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
# Workflow files stored in the default location of `.github/workflows`
# You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.
directory: "/"
schedule:
interval: "weekly"
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setting up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: "1.21"
- name: Building Windows amd64 Version
Expand All @@ -35,7 +35,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setting up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: "1.21"
- name: Building Windows arm64 Version
Expand All @@ -55,7 +55,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setting up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: "1.21"
- name: Building Linux amd64 Version
Expand All @@ -75,7 +75,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setting up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: "1.21"
- name: Building Linux arm64 Version
Expand All @@ -95,7 +95,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setting up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: "1.21"
- name: Building Linux s390x Version
Expand All @@ -115,7 +115,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setting up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: "1.21"
- name: Building Darwin amd64 Version
Expand All @@ -135,7 +135,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setting up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: "1.21"
- name: Building Darwin arm64 Version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3.0.0
uses: docker/setup-buildx-action@v4.4.1

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
- uses: actions/setup-go@v6
with:
go-version: '1.21'
go-version: '1.25'
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setting up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: "1.21"
go-version: "1.25"
- name: Install dependencies
run: sudo apt install wireguard curl
- name: Building wireproxy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wireproxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
cp ./.github/wireproxy-releaser.yml ${{ env.workdir }}/.goreleaser.yml

- name: Set up GoReleaser
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: "1.21"

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Start by building the application.
FROM docker.io/golang:1.21 as build
FROM docker.io/golang:1.25 as build

WORKDIR /usr/src/wireproxy
COPY . .
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ with a discount using [this referral link](https://iproyal.com/?r=795836)! 🚀
```

```bash
usage: wireproxy [-h|--help] [-c|--config "<value>"] [-s|--silent]
[-d|--daemon] [-i|--info "<value>"] [-v|--version]
[-n|--configtest]
usage: wireproxy [-h|--help] [-c|--config "<value>"] [-s|--silent]
[-v|--verbose] [-d|--daemon] [-i|--info "<value>"]
[-V|--version] [-n|--configtest]

Userspace wireguard client for proxying

Expand All @@ -61,10 +61,11 @@ Arguments:
-h --help Print help information
-c --config Path of configuration file
Default paths: /etc/wireproxy/wireproxy.conf, $HOME/.config/wireproxy.conf
-s --silent Silent mode
-s --silent Logging: Set silent mode
-v --verbose Logging: Set verbose mode
-d --daemon Make wireproxy run in background
-i --info Specify the address and port for exposing health status
-v --version Print version
-V --version Print version
-n --configtest Configtest mode. Only check the configuration file for
validity.
```
Expand Down
47 changes: 27 additions & 20 deletions cmd/wireproxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"context"
"fmt"
"github.com/landlock-lsm/go-landlock/landlock"
"log"
"net"
"net/http"
Expand All @@ -13,6 +12,8 @@ import (
"strconv"
"syscall"

"github.com/landlock-lsm/go-landlock/landlock"

"github.com/akamensky/argparse"
"github.com/pufferffish/wireproxy"
"golang.zx2c4.com/wireguard/device"
Expand All @@ -23,9 +24,9 @@ import (
const daemonProcess = "daemon-process"

// default paths for wireproxy config file
var default_config_paths = []string {
"/etc/wireproxy/wireproxy.conf",
os.Getenv("HOME")+"/.config/wireproxy.conf",
var default_config_paths = []string{
"/etc/wireproxy/wireproxy.conf",
os.Getenv("HOME") + "/.config/wireproxy.conf",
}

var version = "1.0.8-dev"
Expand Down Expand Up @@ -59,12 +60,12 @@ func executablePath() string {

// check if default config file paths exist
func configFilePath() (string, bool) {
for _, path := range default_config_paths {
if _, err := os.Stat(path); err == nil {
return path, true
}
}
return "", false
for _, path := range default_config_paths {
if _, err := os.Stat(path); err == nil {
return path, true
}
}
return "", false
}

func lock(stage string) {
Expand Down Expand Up @@ -175,10 +176,12 @@ func main() {
parser := argparse.NewParser("wireproxy", "Userspace wireguard client for proxying")

config := parser.String("c", "config", &argparse.Options{Help: "Path of configuration file"})
silent := parser.Flag("s", "silent", &argparse.Options{Help: "Silent mode"})
silent := parser.Flag("s", "silent", &argparse.Options{Help: "Logging: Set silent mode"})
verbose := parser.Flag("v", "verbose", &argparse.Options{Help: "Logging: Set verbose mode"})

daemon := parser.Flag("d", "daemon", &argparse.Options{Help: "Make wireproxy run in background"})
info := parser.String("i", "info", &argparse.Options{Help: "Specify the address and port for exposing health status"})
printVerison := parser.Flag("v", "version", &argparse.Options{Help: "Print version"})
printVerison := parser.Flag("V", "version", &argparse.Options{Help: "Print version"})
configTest := parser.Flag("n", "configtest", &argparse.Options{Help: "Configtest mode. Only check the configuration file for validity."})

err := parser.Parse(args)
Expand All @@ -193,12 +196,12 @@ func main() {
}

if *config == "" {
if path, config_exist := configFilePath(); config_exist {
*config = path
} else {
fmt.Println("configuration path is required")
return
}
if path, config_exist := configFilePath(); config_exist {
*config = path
} else {
fmt.Println("configuration path is required")
return
}
}

if !*daemon {
Expand Down Expand Up @@ -237,14 +240,18 @@ func main() {
// https://github.com/WireGuard/wireguard-go/blob/master/device/logger.go#L39
// so redirect STDOUT to STDERR, we don't want to print anything to STDOUT anyways
os.Stdout = os.NewFile(uintptr(syscall.Stderr), "/dev/stderr")
logLevel := device.LogLevelVerbose
logLevel := device.LogLevelError
if *silent {
logLevel = device.LogLevelSilent

} else if *verbose {
logLevel = device.LogLevelVerbose
}

lock("ready")
var errorLogger = device.NewLogger(logLevel, "wireproxy - ")

tun, err := wireproxy.StartWireguard(conf.Device, logLevel)
tun, err := wireproxy.StartWireguard(conf.Device, errorLogger)
if err != nil {
log.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,15 @@ func parseCIDRNetIP(section *ini.Section, keyName string) ([]netip.Addr, error)
if len(str) == 0 {
continue
}

if addr, err := netip.ParseAddr(str); err == nil {
ips = append(ips, addr)
} else {
prefix, err := netip.ParsePrefix(str)
if err != nil {
return nil, err
}

addr := prefix.Addr()
ips = append(ips, addr)
}
Expand Down
3 changes: 2 additions & 1 deletion config_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package wireproxy

import (
"github.com/go-ini/ini"
"testing"

"github.com/go-ini/ini"
)

func loadIniConfig(config string) (*ini.File, error) {
Expand Down
18 changes: 8 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
module github.com/pufferffish/wireproxy

go 1.21.1

toolchain go1.21.6
go 1.24.0

require (
github.com/MakeNowJust/heredoc/v2 v2.0.1
github.com/akamensky/argparse v1.4.0
github.com/go-ini/ini v1.67.0
github.com/landlock-lsm/go-landlock v0.0.0-20240216195629-efb66220540a
github.com/things-go/go-socks5 v0.0.5
golang.org/x/net v0.33.0
github.com/landlock-lsm/go-landlock v0.0.0-20250303204525-1544bccde3a3
github.com/things-go/go-socks5 v0.1.0
golang.org/x/net v0.48.0
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173
suah.dev/protect v1.2.3
suah.dev/protect v1.2.4
)

require (
github.com/google/btree v1.1.2 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/crypto v0.46.0 // indirect
golang.org/x/sys v0.39.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
gvisor.dev/gvisor v0.0.0-20230927004350-cbd86285d259 // indirect
kernel.org/pub/linux/libs/security/libcap/psx v1.2.69 // indirect
kernel.org/pub/linux/libs/security/libcap/psx v1.2.70 // indirect
)
34 changes: 17 additions & 17 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A=
github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU=
github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
github.com/landlock-lsm/go-landlock v0.0.0-20240216195629-efb66220540a h1:dz+a1MiMQksVhejeZwqJuzPawYQBwug74J8PPtkLl9U=
github.com/landlock-lsm/go-landlock v0.0.0-20240216195629-efb66220540a/go.mod h1:1NY/VPO8xm3hXw3f+M65z+PJDLUaZA5cu7OfanxoUzY=
github.com/landlock-lsm/go-landlock v0.0.0-20250303204525-1544bccde3a3 h1:zcMi8R8vP0WrrXlFMNUBpDy/ydo3sTnCcUPowq1XmSc=
github.com/landlock-lsm/go-landlock v0.0.0-20250303204525-1544bccde3a3/go.mod h1:RSub3ourNF8Hf+swvw49Catm3s7HVf4hzdFxDUnEzdA=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/things-go/go-socks5 v0.0.5 h1:qvKaGcBkfDrUL33SchHN93srAmYGzb4CxSM2DPYufe8=
github.com/things-go/go-socks5 v0.0.5/go.mod h1:mtzInf8v5xmsBpHZVbIw2YQYhc4K0jRwzfsH64Uh0IQ=
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
github.com/stretchr/testify v1.11.0 h1:ib4sjIrwZKxE5u/Japgo/7SJV3PvgjGiRNAvTVGqQl8=
github.com/stretchr/testify v1.11.0/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/things-go/go-socks5 v0.1.0 h1:4f5dz0iMQ6cA4wseFmyLmCHmg3SWJTW92ndrKS6oERg=
github.com/things-go/go-socks5 v0.1.0/go.mod h1:Riabiyu52kLsla0YmJqunt1c1JEl6iXSr4bRd7swFEA=
golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=
golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=
golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=
golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeunTOisW56dUokqW/FOteYJJ/yg=
Expand All @@ -33,7 +33,7 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gvisor.dev/gvisor v0.0.0-20230927004350-cbd86285d259 h1:TbRPT0HtzFP3Cno1zZo7yPzEEnfu8EjLfl6IU9VfqkQ=
gvisor.dev/gvisor v0.0.0-20230927004350-cbd86285d259/go.mod h1:AVgIgHMwK63XvmAzWG9vLQ41YnVHN0du0tEC46fI7yY=
kernel.org/pub/linux/libs/security/libcap/psx v1.2.69 h1:IdrOs1ZgwGw5CI+BH6GgVVlOt+LAXoPyh7enr8lfaXs=
kernel.org/pub/linux/libs/security/libcap/psx v1.2.69/go.mod h1:+l6Ee2F59XiJ2I6WR5ObpC1utCQJZ/VLsEbQCD8RG24=
suah.dev/protect v1.2.3 h1:aHeoNwZ9YPp64hrYaN0g0djNE1eRujgH63CrfRrUKdc=
suah.dev/protect v1.2.3/go.mod h1:n1R3XIbsnryKX7C1PO88i5Wgo0v8OTXm9K9FIKt4rfs=
kernel.org/pub/linux/libs/security/libcap/psx v1.2.70 h1:HsB2G/rEQiYyo1bGoQqHZ/Bvd6x1rERQTNdPr1FyWjI=
kernel.org/pub/linux/libs/security/libcap/psx v1.2.70/go.mod h1:+l6Ee2F59XiJ2I6WR5ObpC1utCQJZ/VLsEbQCD8RG24=
suah.dev/protect v1.2.4 h1:iVZG/zQB63FKNpITDYM/cXoAeCTIjCiXHuFVByJFDzg=
suah.dev/protect v1.2.4/go.mod h1:vVrquYO3u1Ep9Ez2z8x+6N6/czm+TBmWKZfiXU2tb54=
Loading
Loading