Skip to content

A proxy for accessing mDNS hosts from another network interface

License

Notifications You must be signed in to change notification settings

fornellas/mdns-proxy

Repository files navigation

Latest Release Push Go Report Card Go Reference License: GPL v3 Buy me a beer: donate

mDNS Proxy

This is a HTTP proxy that forwards requests to mDNS hosts:

  • Requests to base domain (eg: example.com) shows a list of links to discovered mDNS hosts.
  • Each mDNS host (eg: foo.local) is accessible via a subdomain (eg: foo.example.com).

This is useful is situations where you have a secure network with mDNS hosts (eg: ESPHome IoT devices, which may lack strong security) and want to access control to its hosts.

An example setup would be to run this at a server that's connected to both the client network and the mDNS servers secure network:

Client network < Server > mDNS secure network

The server can restrict traffic to the mDNS secure network, and a Nginx can be setup to take care of access control:

Browser > Nginx > mDNS proxy > mDNS host

Install

Pick the latest release with:

GOARCH=$(case $(uname -m) in i[23456]86) echo 386;; x86_64) echo amd64;; armv6l|armv7l) echo arm;; aarch64) echo arm64;; *) echo Unknown machine $(uname -m) 1>&2 ; exit 1 ;; esac) && wget -O- https://github.com/fornellas/mdns-proxy/releases/latest/download/mdns-proxy.linux.$GOARCH.gz | gunzip > mdns-proxy && chmod 755 mdns-proxy
./mdns-proxy server --base-domain example.com

Development

Docker is used to create a reproducible development environment on any machine:

git clone git@github.com:fornellas/mdns-proxy.git
cd mdns-proxy/
./make.sh help