Skip to main content

This is mdns-filoxy, the mDNS filter proxy!

Project description

mdns-filoxy

PyPI - Version PyPI - Python Version


This is mdns-filoxy, the mDNS filter proxy!

Table of contents

Introduction

Welcome to mdns-filoxy, the mDNS filter proxy.

What is it for?

mdns-filoxy allows you to send configured mDNS service queries out a specified interface, cache the response, and then listen for further queries and answer them on a different interface.

This is particularly useful when you (rather smartly) put your IoT devices in a different network/VLAN to your "main" network. I have my Sonos speakers setup this way, and without some form of proxy, I simply cannot talk to them anymore, because of their odd use of mDNS and SSDP, and 14,000 other convoluted methods to reach their ecosystem.

But isn't that what avahi-daemon et al are for?!

avahi-daemon does have a reflector mode, and there are other packages like mdns-repeater. The issue is that they both listen for queries and then just re-send them out other interfaces. avahi-daemon even lets you filter reflections, but they don't allow you to control the direction of the reflecting.

Furthermore, in the case where you have some other server on the same networks, with two or more interfaces bound to it, systemd can have a rather major meltdown whilst it tries to think for you and choose unique mDNS names. A good example of this is Home Assistant's HAOS. systemd behaves badly with mdns repeaters too.

Draw me a picture

Ok. Lets pretend you have a phone that sits in a VLAN, connected to a firewall interface called eth0 (known as the dest-interface). Lets further pretend your Sonos speaker is in another VLAN, connected to iot0 (known as the --source-interface).

When mdns-filoxy starts, it will bind to the specified interfaces, and on the source interface will query for the chosen services (--mdns-services):

flowchart LR
  Firewall -->|iot0| mc[Multicast to VLAN
  query for mdns-services] --> sonos[Speakers respond]-->|iot0 reply| Firewall

mdns-filoxy caches that response, and then lies in wait, ready to respond to any queries that arrive on eth0.

Once mdns-filoxy is up and listening, here's the sequence of events:

flowchart LR
    phone[Phone
    Sonos app
    launched] --> mc[Multicast to VLAN
    query for _sonos._tcp.local.] -->|eth0| Firewall -->|eth0 reply| phone

Notice that the queries and responses aren't bi-directional, and this is intentional. The software is meant to give minimal assistance to mDNS/IoT devices to get bootstrapped and then on with whatever other evil protocol(s) they use.

What's with the name?!

filoxy is my blend of "filter" and "proxy", as that's basically what this software does.

Installation

The recommended way to install mdns-filoxy is to use pipx.

After getting pipx installed, simply run:

username@host:~$ pipx install mdns-filoxy

[!WARNING] Please don't use pip system-wide.

You can of course also install it using classic virtualenvs.

License

mdns-filoxy is distributed under the terms of the MIT license.

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

mdns_filoxy-1.0.4.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

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

mdns_filoxy-1.0.4-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file mdns_filoxy-1.0.4.tar.gz.

File metadata

  • Download URL: mdns_filoxy-1.0.4.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mdns_filoxy-1.0.4.tar.gz
Algorithm Hash digest
SHA256 da72f71f3da0041e5d0d1255470744a45582222171f9e9724d09f2da2aae02de
MD5 ac9e2f38914d50e4a9c30013eb8bc08e
BLAKE2b-256 f3527de92c19cad8f0ddaac7bde6ade38dcaeb9520af7528b87ff017c3a2f63a

See more details on using hashes here.

Provenance

The following attestation bundles were made for mdns_filoxy-1.0.4.tar.gz:

Publisher: python-publish.yml on lingfish/mdns-filoxy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mdns_filoxy-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: mdns_filoxy-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mdns_filoxy-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 126c24dbbc8e52ae4ead8c578020c714900ce721c41166da9c4d5d6cd889a34d
MD5 276c3c3013bcfeda7f2e9ddc180399c0
BLAKE2b-256 a71525e9e183f8f9791c23569b9295273fba1e8a4c14309dd6fcf6e5d0a40896

See more details on using hashes here.

Provenance

The following attestation bundles were made for mdns_filoxy-1.0.4-py3-none-any.whl:

Publisher: python-publish.yml on lingfish/mdns-filoxy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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