Socket
Book a DemoInstallSign in
Socket

capacitor-zeroconf

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capacitor-zeroconf

Capacitor ZeroConf plugin

latest
Source
npmnpm
Version
4.0.0
Version published
Weekly downloads
223
-13.23%
Maintainers
1
Weekly downloads
 
Created
Source

capacitor-zeroconf

Capacitor ZeroConf plugin

This plugin allows you to browse and publish ZeroConf/Bonjour/mDNS services from applications developed using Ionic's Capacitor.

This is not a background service. When the cordova view is destroyed/terminated, publish and watch operations are stopped.

Android, iOS and Electron platforms are supported.

The has been ported from Cordova ZeroConf Plugin.

Install

npm install capacitor-zeroconf
npx cap sync

or

yarn add capacitor-zeroconf
yarn cap sync

API

addListener('discover', ...)

addListener(eventName: 'discover', listenerFunc: (result: ZeroConfWatchResult) => void) => Promise<PluginListenerHandle>
ParamType
eventName'discover'
listenerFunc(result: ZeroConfWatchResult) => void

Returns: Promise<PluginListenerHandle>

getHostname()

getHostname() => Promise<{ hostname: string; }>

Returns: Promise<{ hostname: string; }>

register(...)

register(request: ZeroConfRegisterRequest) => Promise<void>
ParamType
requestZeroConfRegisterRequest

unregister(...)

unregister(request: ZeroConfUnregisterRequest) => Promise<void>
ParamType
requestZeroConfUnregisterRequest

stop()

stop() => Promise<void>

watch(...)

watch(request: ZeroConfWatchRequest, callback?: ZeroConfWatchCallback | undefined) => Promise<CallbackID>
ParamType
requestZeroConfWatchRequest
callbackZeroConfWatchCallback

Returns: Promise<string>

unwatch(...)

unwatch(request: ZeroConfUnwatchRequest) => Promise<void>
ParamType
requestZeroConfWatchRequest

close()

close() => Promise<void>

Interfaces

PluginListenerHandle

PropType
remove() => Promise<void>

ZeroConfService

PropType
domainstring
typestring
namestring
portnumber
hostnamestring
ipv4Addressesstring[]
ipv6Addressesstring[]
txtRecord{ [key: string]: string; }

ZeroConfRegisterRequest

PropType
portnumber
props{ [key: string]: string; }

ZeroConfUnregisterRequest

PropType
namestring

ZeroConfWatchRequest

PropType
typestring
domainstring

Type Aliases

ZeroConfWatchResult

{ action: ZeroConfWatchAction; service: ZeroConfService; }

ZeroConfWatchAction

'added' | 'removed' | 'resolved'

ZeroConfWatchCallback

(event: ZeroConfWatchResult): void

CallbackID

string

ZeroConfUnwatchRequest

ZeroConfWatchRequest

Keywords

capacitor

FAQs

Package last updated on 09 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts