GithubHelp home page GithubHelp logo

simpdiscover's Introduction

Simpdiscover

Simpdiscover is a simple rust crate to facilitate discovery of services within the Local Area network (LAN) using UDP Broadcast datagrams or "beacons".

The 'announcer' of a service could be a process on another machines, or another threads or process on the same machine.

Goals

  • LAN wide detection of named services and what IP they are at
  • Simple to understand and use
  • Small, few dependencies on the library and small memory and cpu footprint
  • Simple beacon format that is easy to use and that doesn't introduce specific file format support into the library

Non-Goals

  • Discovery of services across LANs, WANs, the Web or in the cloud.

Implemented so far

  • BeaconSender struct that can be setup to send beacons:
    • with a specific beacon content String
    • on a specific port
    • with methods to:
      • send forever in a loop at a given time period
      • send just one beacon
  • Simple BeaconListener struct that can be setup to receive beacons:
    • matching a specific message contents
    • with a method that blocks sender and waits until a message is received
      • with an optional timeout value to wait for or None to wait indefinitely
  • Simple 'announce' and 'listen' binaries that use the library as examples
  • A some Doc tests to keep the API docs correct
  • Github Action to build then clippy check then test all

'announce' binary

Run this binary from the repo using cargo run --bin announce or just announce if you have installed the crate with cargo.

It takes an optional command line parameter to specify the String for the beacon message to announce: cargo run --bin announce -- Hello

'listen' binary

Run this binary from the repo using cargo run --bin listen or just listen if you have installed the crate with cargo.

It takes an optional command line parameter to specify the String for the beacon message to wait for before exiting: cargo run --bin listen -- Hello

Future work

I have taken most of my notes on future work and converted them into GitHub issues.

Some are just questions about things I don't understand and would love experts on UDP and rust to explain them to me.

Please comment or start any you are interested in being implemented.

PRs are obviously welcome, if accompanied by some doc comments, doc tests or tests.

Developers

  • Clone/Fork the repo and download:
  • cd into the directory
  • Add changes, add doc comments and/or doc tests and tests.
  • cargo build
  • cargo test
  • cargo clippy -- -D warnings
  • Create a PR
  • Github actions will run the same steps as above
  • I will review and merge

simpdiscover's People

Contributors

andrewdavidmackenzie avatar sigaloid avatar

Stargazers

Zachary Tomlinson avatar Rouven Hi! avatar Peter Jaeckel avatar  avatar SilenceWu avatar Jens Mertelmeyer avatar Xiaopeng Li avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

simpdiscover's Issues

Start sender in background

Maybe do with async code and allow it to have multiple timers and beacons sending, avoiding a thread per beacon/timing

Add port and protocol fields to beacon

so that we can announce a service on a different port from the datagram being sent on, and to know more about how to connect to it: IP (done), port and protocol (http etc etc).

Service meta-data

  • include an arbitrary Byte sequence to also send as meta-data
    client must serialize so we don't need to include a serialization lib or format

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.