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
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
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.
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.
“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.
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.
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.
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
If you’re just looking to debug APIs I highly recommend Runscope. It’s a handy remote proxy https://www.runscope.com/docs/debugging.
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
“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:
[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:
Next, configure your Roku to connect to the new ad-hoc network:
Next, install Wireshark if you haven’t already installed it:
Finally, capture and examine your Roku traffic:
Prajwal! It’s Tim! We got this working on OSX.
Note: This was tested with OS X 10.10 Yosemite
- Connect a Cat 5 ethernet cable to your Roku and your Mac’s ethernet port (I used the thunderbolt adapter)
- Go to System Preferences → Sharing → Internet Sharing
- Under "Share your connection from: ", select your WiFi. Then under "To computers using: ", select Thunderbolt Ethernet.
- Start up Charles and take note of the HTTP Proxy port set under Proxy Settings, by default its 8888. Make sure “Enable transparent HTTP Proxying” is checked.
- To route all traffic to the Charles proxy, we need to set the following Port Forwarding rule in the OS X terminal:
echo "
rdr pass inet proto tcp from any to any port http → 127.0.0.1 port 8888
rdr pass inet proto tcp from any to any port https → 127.0.0.1 port 8888
rdr pass inet proto udp from any to any port http → 127.0.0.1 port 8888
rdr pass inet proto udp from any to any port https → 127.0.0.1 port 8888
" | sudo pfctl -ef -
After hitting enter it will prompt you to enter your machine password- Connect the Roku to WIred (Ethernet) in the Network settings, and you should get a prompt to accept a connection in Charles once an internet request is made on the device
Note the Roku IP so you can debug using telnet
Has anyone figured out how to replicate this in Windows? Beating my head on the wall at this point…
Thanks
“tim_beynart” wrote:
Prajwal! It’s Tim! We got this working on OSX.Note: This was tested with OS X 10.10 Yosemite
- Connect a Cat 5 ethernet cable to your Roku and your Mac’s ethernet port (I used the thunderbolt adapter)
- Go to System Preferences → Sharing → Internet Sharing
- Under "Share your connection from: ", select your WiFi. Then under "To computers using: ", select Thunderbolt Ethernet.
- Start up Charles and take note of the HTTP Proxy port set under Proxy Settings, by default its 8888. Make sure “Enable transparent HTTP Proxying” is checked.
- To route all traffic to the Charles proxy, we need to set the following Port Forwarding rule in the OS X terminal:
echo "
rdr pass inet proto tcp from any to any port http → 127.0.0.1 port 8888
rdr pass inet proto tcp from any to any port https → 127.0.0.1 port 8888
rdr pass inet proto udp from any to any port http → 127.0.0.1 port 8888
rdr pass inet proto udp from any to any port https → 127.0.0.1 port 8888
" | sudo pfctl -ef -
After hitting enter it will prompt you to enter your machine password- Connect the Roku to WIred (Ethernet) in the Network settings, and you should get a prompt to accept a connection in Charles once an internet request is made on the device
Note the Roku IP so you can debug using telnet
This method worked for me and I see the http call without any error in charles but https calls does not work. Roku does not have option to install the charles certificate in Roku device. Do you have any input for https:// calls
This method worked for me and I see the http call without any error in charles but https calls does not work. Roku does not have option to install the charles certificate in Roku device. Do you have any input for https:// calls
we are trying to work out https, apparently you have to install the cert using Brightscript and forward all traffic to Charles. I’ll post once we get it to work.
I had no luck getting https to work with Charles. I have the iptable rules set up in a DDWRT router and route all traffic to the ip hosting Charles. I have the Charles cert in my app and point to it using “setCertificatesFile” for each instance of roUrlTransfer. But the secure traffic just shows up as blank lines with “invalid first character” errors.
I am out of my depth here, if anyone has figured out how to capture https then please let us know!
I have not gotten this to work for HTTPS at all. I tried every way to install a Charles cert I could think of, as did multiple other people here at work.
Wireshark is an option to at least see the HTTPS requests happening (not decrypted), but it it hideous to work with. Charles is part of our workflow for all other devices and platforms, I really wish Roku would add the ability to define a proxy like iOS and Android.
We reached out to Roku for assistance and are waiting for some guidance.
+1. Anything from Roku on this?
I’m 99% sure that you cannot do this.
The entire purpose of HTTPS is to prevent this.
Care to explain why? You can easily set up MITM with Charles on desktop. I am not a networking guru, so I would love a simple explanation of why this is impossible on a Roku.
I see no reason why you can’t set up a pass-through proxy by using whatever fudged SSL certificate client side it wants you to for a MitM. That does not contradict HTTPS security, since it is the client app that “willingly decides” to trust an additional cert. authority.
I am not in the thick of things here - but i heard from a 3rd party they’ve had problems setting Charles Proxy as MitM - but success using https://mitmproxy.org/ with Roku.
@tim_beynart - what did your inquiry with us resulted in?