MIT License

项目介绍

Gandem/bonjour-reflector 是一个托管在 GitHub 上的开源项目,主要使用 Go 编写,采用 MIT License 许可证,目前获得 187 个 Star、23 次 Fork。

仓库全名
Gandem/bonjour-reflector
开源许可证
MIT License
Star 数
187
Fork 数
23
未关闭 Issue
7

README 摘要

bonjour-reflector About this project Bonjour-reflector makes Bonjour devices such as printers, Chromecasts or Spotify Connect speakers, discoverable and usable by other devices located on different VLANs. Compared to other tools such as avahi-reflector, Bonjour-reflector allows a more fine-grained control of how Bonjour traffic is reflected across VLANs. How it works Bonjour-reflector works by intercepting all mDNS…

完整内容见 GitHub 原始 README 或本页 。

常见问题

bonjour-reflector 用什么语言开发?

主要使用 Go 编写,采用 MIT License 许可证,目前有 187 个 Star。

bonjour-reflector 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 bonjour-reflector 的源码?

可以直接克隆仓库:git clone https://github.com/Gandem/bonjour-reflector.git,默认分支为 master;安装与运行步骤见仓库 README。

bonjour-reflector 最近还在维护吗?

仓库最近一次更新为 2022年10月6日,当前有 7 个未关闭 Issue;Star 数为 187,可作为社区活跃度的参考。

关于

A reflector that forwards mdns packets between VLANs - like avahi-reflector but with fine-grained control !

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
246
价值分
120
活跃状态
活跃

README

bonjour-reflector

About this project

Bonjour-reflector makes Bonjour devices such as printers, Chromecasts or Spotify Connect speakers, discoverable and usable by other devices located on different VLANs.

Compared to other tools such as avahi-reflector, Bonjour-reflector allows a more fine-grained control of how Bonjour traffic is reflected across VLANs.

How it works

Bonjour-reflector works by intercepting all mDNS traffic and rewriting layers 2 and 3 of the packets to reflect them across the appropriate VLANs.

A configuration file lists, for each Bonjour device (defined by its MAC address), which VLANs should have access to this device. mDNS packets will only be forwarded if the configuration file says so.

The interface on which Bonjour-reflector runs should be configured so that it receives each VLAN’s traffic, tagged.

In detail, here is what happens when Bonjour-reflector runs:

  • a device searching for Bonjour devices sends mDNS packets on his VLAN.
  • bonjour-reflector receives these mDNS packets, tagged with the original VLAN.
  • bonjour-reflector looks up in its configuration to which VLANs it should forward the mDNS request, and send new packets tagged with these new VLANs.
  • one Bonjour device receives the packet and sends a response which is also intercepted by bonjour-reflector.
  • bonjour-reflector reads the source MAC of the mDNS response, looks up in its configuration which VLANs are shared with this Bonjour device, and reflects the mDNS response on each of these VLANs.

Installation

A Golang version more recent than Go 1.16 is recommended to build bonjour-reflector. Checkout https://golang.org/doc/install for instructions on how to install a recent version of Golang.

To build the binary, run:

go build

One of the dependencies of the project (gopacket/pcap) also needs the libpcap header files to work properly. On Linux-based distributions, you can do this by installing the development version of libpcap (package: libpcap-dev).

App setup

First, indicate in the config.toml file which of your network interfaces you want to listen to.

Then run

./bonjour-reflector -config=./config.toml

(you may need to run this line with administrator privileges to listen to your interface).

You may use any configuration file you want (following the same structure as the template ./config.toml file provided) by specifying its path with the -config option.

Contribution

Help on this project is very welcomed. Before submitting your contribution, please make sure to take a moment and read through the following guidelines:

  • The master branch contains the latest stable version of the project. All development should be done in dedicated branches.
  • Try to name your branch in a clear way, for example by following this pattern: username/what-i-am-fixing.
  • Do not check in any compiled binaries in the commits.
  • It’s okay to have multiple small commits as you work on the PR - we will squash them before merging.
  • Make sure all test cases pass (using go test).
  • When fixing a bug:
    • Prefix your PR with Fix:, and add references to the issues linked to your PR (if they exist),
    • Add test coverage if applicable.
  • When adding a new feature:
    • Prefix your PR with Feature:,
    • Add a description of your feature and reasons to add this feature,
    • Add test cases for this feature.

Debugging & Profiling

A pprof server will listen on port 6060 if the you use the -debug flag.

More information on pprof is available here

License

MIT

评论

暂无评论