Skip to main content

A simple python Wake-on-LAN proxy

Project description

Wake-on-LAN redirect proxy

Brutally simple, single file, Fast API based proxy service. Create a simple path and/or hostname based redirects that send WoL packets if target URL is not reachable. Only works for HTTP(S) redirects.

Great complement for a simple auto-suspend setup, e.g. your home jellyfin server or any other HTTP service.

That's it!

Install

# 1. install script - install wol-proxy into a new virtualenv inside your $HOME
 curl https://raw.githubusercontent.com/xyzjonas/wol-redirect-proxy/main/install.sh | bash
# 2. from PyPi
pip install wol-redirect-proxy
# 3. from source using Poetry
poetry install

...and run

wol-proxy --host "0.0.0.0" --port 12345
wol-proxy --help

Configuration

Specify a list of proxy mappings using a yaml config, e.g.:

#  This will WoL redirect any HTTP request and carry over the path.
#  e.g.: POST: http://my-proxy.home/login -> POST "http://my-jellyfin.home:8096/login"

targets:
- handler: "wol"
  source_url: "http://my-proxy.home/*"
  target_url: "http://my-jellyfin.home:8096"
  methods: [GET, POST, DELETE, PATCH]
  options:
    mac: "75:55:39:a4:33:27"
    timeout_s: 2
#  Multiple redirects to different services by hostname
#  (requires working DNS setup)

targets:
- handler: "plain"
  source_url: "http://jellyfin.home/*"
  target_url: "http://192.168.0.124:8096"
  methods: [GET, POST, DELETE, PATCH]
  
- handler: "plain"
  source_url: "http://nextcloud.home/*"
  target_url: "http://192.168.0.129:8080"
  methods: [GET, POST]
  
- handler: "plain"
  source_url: "http://torrent-box.home/*"
  target_url: "http://192.168.0.135:8080"
  methods: [GET, POST]

Use as a systemd service

# use install script and follow instructions
curl https://raw.githubusercontent.com/xyzjonas/wol-redirect-proxy/main/install.sh | bash
# use the sample systemd unit file
git clone https://github.com/jonasbrauer/wol-redirect-proxy.git && cd wol-redirect-proxy 
sudo cp sample-systemd.unit /etc/systemd/system/wol-redirect-proxy.service  # ...and edit user/group
sudo systemctl daemon-reload
sudo systemctl enable --now wol-redirect-proxy.service
sudo systemctl status wol-redirect-proxy.service

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wol_redirect_proxy-1.0.1.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wol_redirect_proxy-1.0.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file wol_redirect_proxy-1.0.1.tar.gz.

File metadata

  • Download URL: wol_redirect_proxy-1.0.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.11.4 Linux/6.4.12-100.fc37.x86_64

File hashes

Hashes for wol_redirect_proxy-1.0.1.tar.gz
Algorithm Hash digest
SHA256 74c4dc47f8daa0fe74b0dfac8d256835206b0c4409747d6f6fa98fbdd0ec8bcf
MD5 caef54d21a6d354b43fd880fd4ae0a9b
BLAKE2b-256 4e6efecd6b84956049670167622004d63877717f0d3fa9ff83ff307d08273703

See more details on using hashes here.

File details

Details for the file wol_redirect_proxy-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: wol_redirect_proxy-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.11.4 Linux/6.4.12-100.fc37.x86_64

File hashes

Hashes for wol_redirect_proxy-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7adef1aa590111836dce461a2384a400fde8ebe998c223977c8c4a165b236391
MD5 9d4f44e5bdba10105bd59eff81c9a073
BLAKE2b-256 225d9a0691db5adf89e4514526d2d1e9e40515fba36ff4c8120d78a220cf1a17

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page