Code Monkey home page Code Monkey logo

hook.io-mdns's Introduction

hook.io-mdns - Advertise and discover hooks nearby through mDNS

Half the purpose of a distributed event bus (i.e. Hook.io) is to distribute over multiple computers, and not just multiple processes. hook.io-mdns wraps .listen(), .connect() and .start() of the standard hook.io Hook object so that they "browse" and "advertise" hooks automatically.

In real life, this means you can use hook.io just as usual, but it will now discover hooks on nearby machines. Sweet isn't it?

Installation

Because of a problem with the mdns npm package, it must be installed manually through my own fork.

 git clone [email protected]:emilisto/node_mdns.git
 cd node_mdns && npm install -g

And then

 git clone [email protected]:emilisto/hook.io-mdns.git
 cd hook.io-mdns && npm install -g

( The -g flags can prolly be dropped if your NODE_PATH is setup properly, haven't gotten my head around this infinitely complicated npm thing just yet, skills are to come. )

Now the magic part!

 node bin/start

Run this on machine #1, and then on another machine #2. Notice how #2 discovers and connects to #1. To see the magic, close both and run node bin/start in opposite order and see how #2 now takes the role as listener and #1 connects to #2.

This is just how one's used to hook.io working locally, but now it works across machines. Imagine the awesomeness possible.

Todo

  • Support finding multiple hooks through some choosing/prioritization mechanism
  • Make it possible for one hook to take over the role as listener if the listener host goes down. Look into how hook.io handles this with locally discovered hooks.
  • A cool example app

hook.io-mdns's People

Contributors

emilisto avatar

Stargazers

 avatar Robin Hawkes avatar

Watchers

Robin Hawkes avatar James Cloos avatar  avatar

Forkers

srinivasarao549

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.