termux-app
termux-app copied to clipboard
Support multicast DNS (mdns) via MulticastLock
Hi, I am trying to use Termux to share files between my android and laptop, but I can't get any code that uses multicast DNS to work. I believe it is because Termux needs to request a MulticastLock: https://stackoverflow.com/questions/13221736/android-device-not-receiving-multicast-package/13223018#13223018
To test if it's working, do pkg install node
and then npm install multicast-dns
and then run node example.js
with this example: https://github.com/mafintosh/multicast-dns/blob/master/example.js. You should see multicast traffic from your network, including your own query.
I have created a mdns relay (respond DNS queries for .local using mDNS). mDNS resolver is apparently working but utils like ping
can't resolve them, I think functions resolving names, getaddrinfo iirc
, aren't using mDNS.
Project is here: https://gitlab.com/mrvik/mdns-proxy
On cmd/resolve/
there is a mDNS client to test the mdns
package.
@mrvik As there seems to be no progress in the transplantation of Avahi, and Android itself seems to have not implemented the function of MDNS server, so it is impossible to use MDNS to access Android devices, I hope you can add the function of MDNS in this program.
Not sure if related, as I came across mDNS-stuff just two days ago.
Android 12 made an adjustment to the DNS Resolver that makes you access .local
via apps like Chrome, no longer limited to specific API.
Also, the default Android hostname is localhost
which is useless, and from this discussion, I guess it's only possible to change the hostname w/ root?
Lastly, avahi
is now available in Termux, see termux/packages#65.