chromecast-audio-stream
chromecast-audio-stream copied to clipboard
Class B Private Address Range is not supported
When I try to stream to a chromecast or a google home, I noticed the following line in stdout:
connected, launching app ... http://false:59702/
When looking at the code for the getIp function, I found the following line in an if block:
details.address.substring(0, 7) === '172.16.'
This leads me to believe that the entire Class B Private Address Range is not supported. The Class B Private Address Range spans from IPs 172.16.0.0 to 172.31.255.255 (subnet mask is 255.240.0.0 or /12). Because my machine sits outside of 172.16, it is unable to find a matching IP to bind to and tries binding to the host named "false". Adding "false" to the hosts file does not appear to work.
Same problem here, but with a private Class A net (10.10.15.x/24 which fails the details.address.substring(0, 5) === '10.0.'
check).
After some research I found this library which seems to have a well implemented check: https://github.com/johnnymastin/check-ip
Perhabs it's an even better idea to get the ip of the selected chromecast and search for a network interface within the same ip-range. I think this could work because we can assume that the chromecast and the source machine are always in the same local network due to the mDNS lookup. What do you think? https://www.npmjs.com/package/ip-range-check
@frostyfrog Adding false to host file does not work because the app communicates the found ip (in our case http://false:59702/ ) as streaming url source to the chromecast (btw: all of my chromecasts seems to use googles dns server 8.8.8.8 as their primary dns source, ignoring the dns server configured on dhcp. Modifing the chromecast dns config or host file would only be possible on a rooted chromecast)