MIT License

技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

深度技术分析:hrzlgnm/mdns-browser

项目背景与痛点

mdns-browser 是一个跨平台的应用程序,用于浏览和发现局域网内的 mDNS 服务。它适用于需要快速发现和管理网络服务的场景。在复杂的网络环境中,手动查找和管理各种服务十分耗时且容易出错。该应用提供了一个统一的界面来解决这一痛点,无论是在 Windows、Mac 还是 Linux 上,都能便捷地浏览服务列表。

核心技术揭秘

mdns-browser 采用了 Rust 编程语言,并结合了 Tauri 框架和 Leptos 库,实现了高性能且跨平台的功能。Rust 的内存安全性和高性能保证了应用的可靠运行,而 Tauri 和 Leptos 提供了现代化的前端和后端技术栈,适用于构建桌面应用程序。

技术架构分析

mdns-browser 的技术架构主要包括几个核心部分:前端界面、后端服务、mDNS 浏览及发现机制等。下面我们来具体分析一下这些模块是如何协同工作的。

详细技术栈与数据流
  • 前端界面 使用 Leptos 框架构建,提供简洁直观的用户界面。
  • 后端服务 使用 Rust 编程语言,调用系统库实现 mDNS 服务的发现和解析。
  • Tauri 框架 负责前端与后端之间的通信和打包,使其成为一个跨平台的应用。
graph TD A[用户界面] --> B[输入新增mDNS服务检测] B --> C{"服务发现"} C -->|"成功"| D[显示发现的mDNS服务] C -->|"失败"| E[显示错误信息] D --> F[服务查看/管理] E --> F

结合架构图,我们可以清晰地看到前端用户操作与后台服务发现、展示的全流程。

功能亮点与差异

mdns-browser 的亮点在于其跨平台能力和简洁的界面设计。它能够在一个应用中同时支持多种操作系统,这对于需要在不同系统之间协作的工作环境尤为便利。相比其他类似的 mDNS 浏览器工具,mdns-browser 使用 Rust 语言编写,从而提供了更好的性能保障和内存安全性,这是其他纯前端实现所无法比拟的。

此外,它还具备简单的配置和管理功能,方便用户快速上手。

应用场景与落地建议

由于跨平台的特性以及简洁的管理界面,mdns-browser 适用于各种需要快速发现和管理 mDNS 服务的环境。例如,在家庭网络中想要快速查看所有连接的设备,或者在企业环境中监控局域网内的各种服务。部署时,需要保证应用对网络的访问权限,以避免因权限问题导致的服务无法发现。

特别提醒,对于大规模企业网络或复杂的 mDNS 服务场景,需手动提供服务发现策略,因为默认配置可能无法涵盖所有细节。

综合评价

优点

  1. 跨平台:支持 Windows、MacOS、Linux。
  2. 高性能:Rust 内存安全性和高效率的优势。
  3. 简洁界面:Leptos 框架带来的高效用户界面。

缺点

  1. 定制性:目前功能较为固定,尚不支持高度定制化的服务发现策略配置。
  2. 用户反馈量:由于项目相对较新,可能存在用户反馈较少的问题,这可能会导致某些边缘情况未被充分考虑。

综上所述,mdns-browser 作为一个轻量级且跨平台的 mDNS 浏览器应用,适用于需要快速发现、管理网络服务的各种环境。其在 Rust 语言和现代前端技术结合的结构设计下,为开发者和管理者提供了高效的工具,值得考虑和使用。

关于

GitHub 原始描述(英文)

A cross platform mDNS-Browser app written in Rust using tauri and leptos

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

CSS
HTML
JavaScript
Rust
Shell

README

GitHub Downloads (all assets, all releases) GitHub Downloads (all assets, latest release) GitHub Release GitHub Release Date WinGet Package Version AUR Version License: MIT Build Status

mDNS-Browser

This application allows you to browse services using mDNS. For an alternative running in a terminal, check out mDNS-TUI-Browser

Screenshots from v0.11.28

Startup

intro

Browsing for _ssh._tcp

browsing-ssh

Details of a resolved service having many IPs

ssh-details

Details of a resolved service having a subtype and TXT records

amzn-details

Checking for updates on Windows

check-update

Response if no update is available

no-update

Building

For instructions on building the application, checkout the document BUILDING.

Command line options

Usage: mdns-browser [OPTIONS]

Options:
  -l, --log-level <LOG_LEVEL>       [default: info] [possible values: trace, debug, info, warn, error]
  -D, --enable-devtools             Enable devtools at startup
  -f, --log-to-file                 Enable logging to file
  -d, --disable-dmabuf-renderer     Disable dmabuf renderer (Linux only), useful when having rendering issues
      --disable-nv-explicit-sync    Disable NVIDIA explicit sync (Linux only)
      --no-nvidia-workaround        Disable all NVIDIA workarounds entirely (Linux only)
  -h, --help                        Print help
  -V, --version                     Print version

log-to-file

If enabled, a log file will be created in a platform-specific location:

  • Windows: %LOCALAPPDATA%\com.github.hrzlgnm.mdns-browser\logs
  • Linux: $XDG_DATA_HOME/com.github.hrzlgnm.mdns-browser/logs or $HOME/.local/share/com.github.hrzlgnm.mdns-browser/logs
  • macOS: ~/Library/Logs/com.github.hrzlgnm.mdns-browser

The log file will be named mdns-browser.log and will contain log messages with a log-level having at least a level specified by the log-level option.

enable-devtools

If enabled, the devtools will be open at startup

This option has been added with release v0.19.0

disable-dmabuf-renderer (Linux only)

This option disables the dmabuf renderer, which is used to improve performance on Linux. If you experience rendering issues, you can try disabling this option to see if it resolves the problem.

This option has been added with release v0.12.0

disable-nv-explicit-sync (Linux only)

This option disables NVIDIA explicit sync, useful for testing or debugging rendering issues on non-NVIDIA systems. This option has been added with release v1.8.0

no-nvidia-workaround (Linux only)

This option disables all NVIDIA workarounds entirely, including automatic detection. Useful for testing whether rendering issues are caused by the workarounds or to completely disable them.

This option takes precedence over both --disable-dmabuf-renderer and --disable-nv-explicit-sync.

Where to find the executables?

GitHub Releases

You can download the latest version of the application from the GitHub Release page

Winget installation

To install via Winget, run the following command:

winget install mdns-browser

Arch Linux (AUR)

To install on Arch Linux using the AUR, you can use an AUR helper like yay or paru:

With yay:

yay -S mdns-browser

Alternatively using the -bin package:

yay -S mdns-browser-bin

With paru:

paru -S mdns-browser

Alternatively using the -bin package:

paru -S mdns-browser-bin

Void Linux

To install on Void Linux with arch x86_64, you can add the GitHub release as a repository and install the package using xbps-install:

# Add the repository
echo "repository=https://github.com/hrzlgnm/mdns-browser/releases/latest/download" | sudo tee /etc/xbps.d/mdns-browser-repo.conf

# Install the package
sudo xbps-install -S mdns-browser

During installation, you will be prompted to accept a public key signed by [email protected]. The repository and package are signed with a key having the fingerprint: 64:6d:b9:23:3d:ad:9d:f1:b0:fe:64:8e:da:46:57:d3.

Homebrew (macOS)

To install on macOS using Homebrew, you can use the custom tap:

brew install --cask hrzlgnm/tap/mdns-browser

Or add the tap first:

brew tap hrzlgnm/tap
brew install --cask mdns-browser

Auditable binaries

The binaries built for desktop targets are now all built in auditable mode using cargo-auditable. For information on how to audit the binaries, see Usage

Since release v0.8.x

Attested build artifacts

The build artifacts are now attested. Attestations information about the binaries is available here. For more information and details on how to verify those, see Verifying artifact attestations with the GitHub CLI

Since release v0.8.x

Privacy

For a privacy statement checkout the document PRIVACY.

Acknowledgments

This app uses the fantastic mdns-sd library to handle all mDNS functionality. If you find this app helpful, consider giving the library a star on GitHub!

评论

暂无评论