Skip to content

Instantly share code, notes, and snippets.

@jack828
Created June 6, 2023 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jack828/0ae09b1a6a2d9fd983a1b50410ad0f98 to your computer and use it in GitHub Desktop.
Save jack828/0ae09b1a6a2d9fd983a1b50410ad0f98 to your computer and use it in GitHub Desktop.
wireproxy freebsd rc.d script
### Get this file from Mullvad
## https://mullvad.net/en/account/#/wireguard-config
[Interface]
PrivateKey = <snip>
Address = 10.65.0.190/32,fc00:bbbb:bbbb:bb01::2:bd/128
DNS = 10.64.0.1
[Peer]
PublicKey = <snop>
AllowedIPs = 0.0.0.0/0,::0/0
Endpoint = 185.248.85.3:51820
WGConfig = /usr/local/wireproxy/mullvad-wg.conf
# TCPClientTunnel is a tunnel listening on your machine,
# and it forwards any TCP traffic received to the specified target via wireguard.
# Flow:
# <an app on your LAN> --> localhost:25565 --(wireguard)--> play.cubecraft.net:25565
#[TCPClientTunnel]
#BindAddress = 127.0.0.1:25565
#Target = play.cubecraft.net:25565
# TCPServerTunnel is a tunnel listening on wireguard,
# and it forwards any TCP traffic received to the specified target via local network.
# Flow:
# <an app on your wireguard network> --(wireguard)--> 172.16.31.2:3422 --> localhost:25545
#[TCPServerTunnel]
#ListenPort = 3422
#Target = localhost:25545
# Socks5 creates a socks5 proxy on your LAN, and all traffic would be routed via wireguard.
[Socks5]
BindAddress = 0.0.0.0:25344
# Socks5 authentication parameters, specifying username and password enables
# proxy authentication.
#Username = ...
# Avoid using spaces in the password field
#Password = ...
# http creates a http proxy on your LAN, and all traffic would be routed via wireguard.
[http]
BindAddress = 0.0.0.0:25345
# HTTP authentication parameters, specifying username and password enables
# proxy authentication.
#Username = ...
# Avoid using spaces in the password field
#Password = ...
#!/bin/sh
# PROVIDE: wireproxy
# REQUIRE: LOGIN
# KEYWORD: shutdown
. /etc/rc.subr
name=wireproxy
rcvar=wireproxy_enable
load_rc_config $name
: ${wireproxy_enable="NO"}
: ${wireproxy_config:="/usr/local/wireproxy/wireproxy.conf"}
pidfile="/var/run/${name}.pid"
procname=/usr/local/wireproxy/wireproxy
command=/usr/sbin/daemon
command_args="-S -T ${name} -f -p ${pidfile} -u root /usr/local/wireproxy/wireproxy -c ${wireproxy_config}"
run_rc_command "$1"
## Wireproxy
# https://github.com/pufferffish/wireproxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment