capacitor-community-smdns
v8.0.0
Published
simple mdns
Readme
capacitor-community-smdns
simple mdns
Currently only works on android.
Install
npm install capacitor-community-smdns
npx cap syncExample
import { smdns } from 'capacitor-community-smdns'
if (Capacitor.isPluginAvailable('smdns')) {
smdns.discoverServices('_http._tcp', {
onServiceFound: (name, host, port) => {
console.log(name, host, port)
}
})
}API
discoverServices(...)
discoverServices(type: string, cb: DiscoverServicesNotify) => void| Param | Type |
| ---------- | ------------------------------------------------------------------------- |
| type | string |
| cb | DiscoverServicesNotify |
Type Aliases
DiscoverServicesNotify
{ onServiceFound?: (name: string, host?: string, port?: number) => void; onServiceLost?: (name: string, host?: string, port?: number) => void; }
