All Projects → balthazar → React Native Zeroconf

balthazar / React Native Zeroconf

Licence: mit
📡 Discover Zeroconf services using react-native

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to React Native Zeroconf

Wormholy
iOS network debugging, like a wizard 🧙‍♂️
Stars: ✭ 2,010 (+1096.43%)
Mutual labels:  network
Nettop
Utility to show network traffic (both TCP and UDP v4 and v6) split by process and remote host
Stars: ✭ 162 (-3.57%)
Mutual labels:  network
Iptools
PHP Library for manipulating network addresses (IPv4 and IPv6)
Stars: ✭ 163 (-2.98%)
Mutual labels:  network
Dublin Traceroute
Dublin Traceroute is a NAT-aware multipath tracerouting tool
Stars: ✭ 159 (-5.36%)
Mutual labels:  network
React Native Network Logger
An HTTP network request monitor for React Native with in-app interface for iOS and Android with no native code
Stars: ✭ 161 (-4.17%)
Mutual labels:  network
Powershell ipv4networkscanner
Powerful asynchronus IPv4 network scanner for PowerShell
Stars: ✭ 161 (-4.17%)
Mutual labels:  network
Sofie Tv Automation
This is the documentation for the state-based studio automation system Sofie, used in live TV news production by the Norwegian public service broadcaster NRK since September 2018.
Stars: ✭ 155 (-7.74%)
Mutual labels:  broadcast
Cs offer
计算机学科基础知识和主流编程语言相关内容的总结
Stars: ✭ 2,016 (+1100%)
Mutual labels:  network
Zxrequestblock
基于NSURLProtocol一句话实现iOS应用底层所有网络请求拦截(含网页ajax请求拦截【不支持WKWebView】)、一句话实现防抓包(使Thor,Charles,Burp等代理抓包方式全部失效,且即使开启了代理,也不影响App内部的正常请求)。包含http-dns解决方法,有效防止DNS劫持。用于分析http,https请求等
Stars: ✭ 160 (-4.76%)
Mutual labels:  network
Mrboom Libretro
Mr.Boom is an 8 player Bomberman clone for RetroArch/Libretro
Stars: ✭ 162 (-3.57%)
Mutual labels:  network
Java Notes
☕️ Java 基础 👫 面向对象思想✏️ 算法 📝 操作系统 ☁️ 网络 💾 数据库 🙊 Spring 💡 系统架构🐘大数据
Stars: ✭ 160 (-4.76%)
Mutual labels:  network
Libae
redis's async event loop library
Stars: ✭ 160 (-4.76%)
Mutual labels:  network
Pycat
Python network tool, similar to Netcat with custom features.
Stars: ✭ 162 (-3.57%)
Mutual labels:  network
Potatso
Potatso is an iOS client that implements Shadowsocks proxy with the leverage of NetworkExtension framework. ***This project is unmaintained, try taking a look at this fork https://github.com/shadowcoel/shadowcoel instead.
Stars: ✭ 1,925 (+1045.83%)
Mutual labels:  network
Tinn
A tiny neural network library
Stars: ✭ 1,944 (+1057.14%)
Mutual labels:  network
Sriov Network Device Plugin
SRIOV network device plugin for Kubernetes
Stars: ✭ 157 (-6.55%)
Mutual labels:  network
Cyberprobe
Capturing, analysing and responding to cyber attacks
Stars: ✭ 162 (-3.57%)
Mutual labels:  network
Libhv
🔥 比libevent、libuv更易用的国产网络库。A c/c++ network library for developing TCP/UDP/SSL/HTTP/WebSocket client/server.
Stars: ✭ 3,355 (+1897.02%)
Mutual labels:  network
Simplenet
An easy-to-use, event-driven, asynchronous network application framework compiled with Java 11.
Stars: ✭ 164 (-2.38%)
Mutual labels:  network
Litenetlib
Lite reliable UDP library for Mono and .NET
Stars: ✭ 2,179 (+1197.02%)
Mutual labels:  network

react-native-zeroconf

Basic Zeroconf implementation for React-native

Get running services advertizing themselves using Zeroconf implementations like Avahi, Bonjour or NSD.

Install

yarn add react-native-zeroconf
# for react-native < 0.60 only (all platforms):
react-native link
# for ios (when using CocoaPods): 
(cd ios && pod install)

You can look at the wiki if you prefer a manual install.

TXT records will be available on iOS and Android >= 7.

For Android please ensure your manifest is requesting all necessary permissions.

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />

IOS 14 Permissions

IOS 14 requires you to specify the services you want to scan for and a description for what you're using them.

In your info.plist add the following strings:

<key>NSBonjourServices</key>
	<array>
		<string>my_service._tcp.</string>
		<string>my_other_service._tcp.</string>
	</array>
<key>NSLocalNetworkUsageDescription</key>
<string>Describe why you want to use local network discovery here</string>

Example

Take a look at the example folder. Install the dependencies, run node server.js and launch the project.

API

import Zeroconf from 'react-native-zeroconf'
const zeroconf = new Zeroconf()
Methods
scan(type = 'http', protocol = 'tcp', domain = 'local.') Start the zeroconf scan

This will initialize the scan from the Zeroconf instance. Will stop another scan if any is running.

stop() Stop the scan

If any scan is running, stop it. Otherwise do nothing.

getServices() Returns resolved services

Will return all names of services that have been resolved.

removeDeviceListeners() Remove listeners

Allow you to clean the listeners, avoiding potential memory leaks (#33).

addDeviceListeners() Add listeners

If you cleaned the listeners and need to get them back on.

publishService(type, protocol, domain, name, port, txt) Publish a service

This adds a service for the current device to the discoverable services on the network.

domain should be the domain the service is sitting on, dot suffixed, for example 'local.' type should be both type and protocol, underscore prefixed, for example '_http._tcp' name should be unique to the device, often the device name port should be an integer txt should be a hash, for example {"foo": "bar"}

unpublishService(name) Unpublish a service

This removes a service from those discoverable on the network.

name should be the name used when publishing the service

Events
zeroconf.on('start', () => console.log('The scan has started.'))
start Triggered on scan start
stop Triggered on scan stop
found Triggered when a service is found

Broadcast a service name as soon as it is found.

resolved Triggered when a service is resolved

Broadcast a service object once it is fully resolved

{
  "host": "XeroxPrinter.local.",
  "addresses": [
    "192.168.1.23",
    "fe80::aebc:123:ffff:abcd"
  ],
  "name": "Xerox Printer",
  "fullName": "XeroxPrinter.local._http._tcp.",
  "port": 8080
}
remove Triggered when a service is removed

Broadcast a service name removed from the network.

update Triggered either when a service is found or removed
error Triggered when an error occurs
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].