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: 

Roku device charles set up

Hi All,

Does anyone had any luck setting up charlesproxy for roku device. Was wondering so that i can track and debug the http calls going away from the roku device.

Thanks in advance.

Regards,
Prajwal
0 Kudos
34 REPLIES 34
TheEndless
Channel Surfer

Re: Roku device charles set up

If you have a network card that supports promiscuous mode, you may have some luck with WireShark, but Roku doesn't support proxies. If you're trying to trace the calls from your channel, then you could just output them all to the debug console as you make them.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
sjb64
Roku Guru

Re: Roku device charles set up

IIRC, you can put your Roku into a packet tracing mode, which creates a cycle of (3 in think) output files than can be read into wireshark as a history file which will parse and display them in complete detail.
0 Kudos
belltown
Roku Guru

Re: Roku device charles set up

"sjb64" wrote:
IIRC, you can put your Roku into a packet tracing mode, which creates a cycle of (3 in think) output files than can be read into wireshark as a history file which will parse and display them in complete detail.

The tcpdump captures are extremely limited though. Only the first 200 bytes or so of each packet are captured. That's often not even enough to capture the http headers.
0 Kudos
sjb64
Roku Guru

Re: Roku device charles set up

OK, that was what I was thinking about, but you have a point that 200 or so bytes certainly isn't "complete detail". Still depending on need it might work, definitely helped me when I was dealing with debugging ECP launching and a M3U8 web server routine.
0 Kudos
belltown
Roku Guru

Re: Roku device charles set up

It has its uses, yes. I just wish they let you capture the whole packet. It's probably a hangover from the days when Rokus had fewer gigabytes in their memories.

Sometimes I'll run my server on my computer connected to the same local network as my Roku, and use Wireshark to capture the traffic on my computer's wireless adapter.
0 Kudos
RokuJoel
Binge Watcher

Re: Roku device charles set up

As I mentioned in an email to a developer today who was having problems with Charles Proxy, you might consider using something that acts as the default gateway for your network, like:

https://mitmproxy.org/
http://grinder.sourceforge.net/g3/tcpproxy.html

http://xmodulo.com/how-to-set-up-transparent-proxy-on-linux.html


- Joel
0 Kudos
gabek
Visitor

Re: Roku device charles set up

If you're just looking to debug APIs I highly recommend Runscope. It's a handy remote proxy https://www.runscope.com/docs/debugging.
0 Kudos

Re: Roku device charles set up

Hi,

Thanks for all the help. Might be foolish question. The scenario i am trying to accomplish is capture all the traffic going out from my roku application from my machine. Both my PC and TV is connected to wireless.

Is there anything else i have to do apart from trying out the below apps.

Regards,
Prajwal
0 Kudos
belltown
Roku Guru

Re: Roku device charles set up

"prajwalshetty" wrote:
Hi,

Thanks for all the help. Might be foolish question. The scenario i am trying to accomplish is capture all the traffic going out from my roku application from my machine. Both my PC and TV is connected to wireless.

Is there anything else i have to do apart from trying out the below apps.

Regards,
Prajwal

Another way to do this if you're running a Windows PC is to set up an ad-hoc network (or "hostednetwork" as they call it now on Windows 8 ), along with ICS (Internet Connection Sharing). Configure your Roku to connect to this network. Now all your Roku traffic will be going through your PC's wireless card, and you can use Wireshark to examine it. As long as your network adapter supports hosted networks this may be the way to go, since you don't need any additional hardware or proxies or APIs. You can capture any traffic going to/from your Roku, not just your own development channel, but other channels as well.

I'm not sure how you'd do this on a Mac or Linux system, but if you have Windows (I've been using it under Windows 8.1), then here are the steps involved:

First, set up the ad-hoc network:

- Start a Windows command prompt (as Administrator!!)
- Type: netsh wlan show drivers
- Find the entry for your wireless interface and look for something that says "Hosted Network Supported: Yes". If it says "Yes" then this should work, otherwise your wireless adapter does not support hosted networks.
- Type: netsh wlan set hostednetwork mode=Allow ssid="my-ssid" key="my-password"
where my-ssid is the name of the new network's ssid and my-password is the password
- Type: netsh wlan start hostednetwork

[Note that each time you restart your computer, or resume from Sleep state, you'll have to reissue the above start hostednetwork command]

Next, set up Internet Connection Sharing:

- Right-click on the wi-fi network icon in the system tray, then select 'Open Network and Sharing Center'
- Click on 'Change Adapter Settings'
- Right-click on the entry for your Wi-Fi adapter (NOT the new ad-hoc network), then click on 'Properties'
- If you successfully started the ad-hoc network you will see a 'Sharing' tab. Click the 'Sharing' tab
- Check the box labelled 'Allow other network users to connect through this computer's Internet connection', then click 'OK'

Next, configure your Roku to connect to the new ad-hoc network:
- Settings>Network>Wireless (Wi-Fi)>Set up new Wi-Fi connection
- Select the ssid you specified above (my-ssid) for the new ad-hoc network, enter the password (my-password), then select Connect

Next, install Wireshark if you haven't already installed it:
- Download from https://www.wireshark.org/download.html. You can use the Windows Installer 64-bit version if you have a 64-bit PC
- Run the installer selecting all default options, making sure to install WInPcap when asked

Finally, capture and examine your Roku traffic:
- Run Wireshark
- In the 'Capture' pane, select your Wi-Fi interface
- Click the green 'Start' icon to start capturing
- You can use the 'Filter' box to filter the traffic you're interested in, e.g. to capture Http traffic to/from my Roku's ip address, I'd type:
http && ip.addr==192.168.0.8
then click 'Apply'
- When you find an entry you're interested in (e.g. an Http GET command), right-click on it and select 'Follow TCP Stream'. This will bring up a window containing the entire Http dialog with options to display it in various formats, save it, etc.
0 Kudos