Added(NsdApi): Network service discovery API.#774
Conversation
|
Example usage: The result is a json object. |
|
This would be great for finding IP's when using Android as the hotspot. Currently I ping all 255-1 IP's in the subnet to find the client which takes a few minutes... as no multicast permission for mDNS or whatnot. Termux:API is the place to do this. Thank you very much! Here's a forward thinking thought on this PR: I remember reading somewhere a Termux maintainer said in Google play reviews that they're very scrutinous of new permissions being added, especially that malware can use. Maybe add a button in the GUI analogous to the current 'GRANT DRAW OVER APPS PERMISSION' button? Forward thinking as Termux isn't currently distributed on Google Play and I guess they're working on getting back, or at least Fornwall's experimental fork was/is. Dunno if this is a good suggestion or not, they could say better. Well that's all I had to say. |
|
@rene-descartes2021 the hotspot is the default gateway for connected devices. You can simply get the address from |
|
@sarg I appreciate the prompt reply. Sorry my use case was unclear, the client is a headless minipc which auto connects to the hotspot when it sees it. Using it as a compute/storage node on the go. I'm unable to ssh into it from Termux until I get its IP somehow- it is headless so no screen or keyboard. I guess I could auto run a script on the client which rsync's a file containing its IP to the gateway along the lines as you suggested... Would have to auto run sshd on Termux. Or some other means of communicating/logging I guess... something with netcat maybe. My initial hope was the client advertising itself with mDNS or whatever zero-config avahi service-thing, but you are right something else might work. Thank you. |
Fixes #688.