Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
S4Tech
Level 7

Accessing Roku Device from Web Application

Hello,

I am attempting to use the External Control Protocol to connect to my home Roku device from my externally hosted web application. I am attempting to retrieve the list of applications installed on the device, using "http://my.device.ip:8060/query/apps", where "my.device.ip" is replaced with the actual device ip address. I keep getting a "Connection Timed Out Error" from my web application; however, when I call the exact same URL from curl, "curl http://my.device.ip:8060/query/apps", I see the expected results. Can someone tell me what I am doing wrong and why I keep getting a connection time out from the web application? I am thinking this is somehow related to security and firewalls, etc., but I don't know how to resolve it. Has anyone been able to get past this issue?

Thanks!
0 Kudos
5 Replies
sjb64
Level 7

Re: Accessing Roku Device from Web Application

Your Roku device is very probably running on a NAT'ed IP (192...) that isn't visible outside your router, and therefore not visible to your "external" web app. You'd have to put your Roku on a static IP visible to the outside world, with all the associated security implications.
FlixRaider channel
0 Kudos
S4Tech
Level 7

Re: Accessing Roku Device from Web Application

Yes, my IP address does start with "192.." so that must be the problem. Well then, I don't really understand the benefit of the External Control Protocol if external web applications can't communicate with the Roku device without jumping through a lot of hoops. I guess I will have to rethink the design on the web application I am trying to build.
0 Kudos
belltown
Level 7

Re: Accessing Roku Device from Web Application

"S4Tech" wrote:
Yes, my IP address does start with "192.." so that must be the problem. Well then, I don't really understand the benefit of the External Control Protocol if external web applications can't communicate with the Roku device without jumping through a lot of hoops. I guess I will have to rethink the design on the web application I am trying to build.

Generally, ECP is used for applications that are external to the Roku as opposed to external to the network. For example, remote control smartphone applications used to control a Roku that is on the same local network. Web applications should be able to communicate with a Roku using ECP without "jumping through a lot of hoops" if they are on the same local network as the Roku.

Even though your web application is hosted remotely, is it being run (from a web browser) by a device on the Roku's local network, or are you trying to access your Roku from a remote location?

There's nothing to stop you using ECP to control a Roku on a different network. However, the network's firewall has to be configured to allow that. By default, this is not usually the case otherwise anyone, anywhere in the world, would have access to a user's Roku. Many routers have a port forwarding option you can use to forward remote requests for a specific port (8060) to a specific local device (192...).
https://github.com/belltown/
0 Kudos
S4Tech
Level 7

Re: Accessing Roku Device from Web Application

That is very good information to know. Yes, my web application is running from a web browser on my laptop that is connected to the same network as the Roku device. When I call the URL from curl/terminal window, I get the expected results but from my web application, I get a connection timeout.
0 Kudos
belltown
Level 7

Re: Accessing Roku Device from Web Application

How exactly are you trying to access the Roku from your web application?
https://github.com/belltown/
0 Kudos