simple mdns
npm install capacitor-community-smdnssimple mdns
Currently only works on android.
``bash`
npm install capacitor-community-smdns
npx cap sync
`ts
import { smdns } from 'capacitor-community-smdns'
if (Capacitor.isPluginAvailable('smdns')) {
smdns.discoverServices('_http._tcp', {
onServiceFound: (name, host, port) => {
console.log(name, host, port)
}
})
}
`
* discoverServices(...)
* Type Aliases
`typescript`
discoverServices(type: string, cb: DiscoverServicesNotify) => void
| Param | Type |
| ---------- | ------------------------------------------------------------------------- |
| type | string |
| cb` | DiscoverServicesNotify |
--------------------
#### DiscoverServicesNotify
{ onServiceFound?: (name: string, host?: string, port?: number) => void; onServiceLost?: (name: string, host?: string, port?: number) => void; }