GithubHelp home page GithubHelp logo

coqsenpate / zeroconf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vstirbu/zeroconf

0.0 2.0 0.0 3.11 MB

ZeroConf plugin for Cordova/Phonegap 3.0

License: MIT License

Java 85.84% JavaScript 14.16%

zeroconf's Introduction

ZeroConf plugin for Cordova/Phonegap

This plugin allows you to browse and publish ZeroConf/Bonjour/mDNS services from applications developed using PhoneGap/Cordova 3.0 or newer. For older versions use ZeroConf.

GitHub version

Adding the Plugin to your project

In your application project directory:

cordova plugins add https://github.com/vstirbu/ZeroConf

Using the plugin

There are five static methods on the ZeroConf object, as follows:

watch(type, callback)

Note that type is a fully-qualified service type, including the domain, e.g. "_http._tcp.local."

callback is a function that is called when services are added and removed. The function is passed an object with the following structure:

{
	"service": {
		"port": 50930,
		"protocol": "tcp",
		"application": "http",
		"urls": ["http://192.168.2.2:50930", "http://fe80::7256:81ff:fe00:99e3:50930"],
		"description": "\\00",
		"name": "Black iPod",
		"domain": "local",
		"server": "",
		"addresses": ["192.168.2.2", "fe80::7256:81ff:fe00:99e3"],
		"type": "_http._tcp.local.",
		"qualifiedname": "Black iPod._http._tcp.local."
	},
	"action": "added"
}

For more information on the fields, see the JmDNS docs. If you edit ZeroConf.java, you can easily add more fields if you need them.

unwatch(type)

Stops watching for services of the specified type.

close()

Closes the service browser and stops watching.

register(type, name, port, text)

Publishes a new service. The fields are as in the structure above. For more information, see the JmDNS docs.

unregister()

Unregisters all published services.

Credits

Original plugin ZeroConf developed by Matt Kane / Triggertrap Ltd.

It depends on the JmDNS library. Bundles the jmdns.jar library.

Licence

The MIT License

zeroconf's People

Contributors

vstirbu avatar bitdeli-chef avatar ascorbic avatar

Watchers

Nicolas Leclerc avatar James Cloos avatar

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.