Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
S4Tech
Visitor

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 5
sjb64
Roku Guru

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.
0 Kudos
S4Tech
Visitor

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
Roku Guru

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...).
0 Kudos
S4Tech
Visitor

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
Roku Guru

Re: Accessing Roku Device from Web Application

How exactly are you trying to access the Roku from your web application?
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.