In my current project, I am aiming to replicate the functionality of a Chromecast on a Roku device. To achieve this, I need to first discover the Roku using UDP and then send an HTTP POST request to control it.
During a recent developer fest where I learned about the Chromecast, I was intrigued by how it uses SSDP for discovery. This inspired me to create an extension (heavily modified) that successfully locates my Roku device.
However, controlling the Roku has posed a challenge. I have encountered issues with sending requests to a different port (such as :8060) due to what I believe is a same origin policy. I am curious if anyone can shed light on how the Chromecast operates and if its methods could be adapted for my project. Alternatively, if you have a solution for enabling my extension to send an HTTP POST request to :8060 with a path like /keypress/Select, I would greatly appreciate any insights.
It is worth noting that when I attempt to send an XMLHttpRequest with just the IP address (without specifying the port), I receive a 200 successful response. However, this does not actually control the Roku. My understanding is that the port must be included for proper functionality.