If you are looking for a good solution for HbbTV testing and you don’t want to purchase an expensive broadcast hardware solution check out this simple USB to DVB-T transmission device.
This assumes you have 2 or more devices connected to the same network and that one of the machines is set up to run a proxy server such as Charles Proxy. This also serves as a simple tutorial on how to get devices to use a secure proxy/vpn/tunnel to either test or bypass IP based geo blocking / restriction services.
You will also need an ssh server such as a basic Linux instance in one of the Amazon regions.
1. On your OS X machine setup a ssh tunnel, note you need to replace the path to your .pem and also make sure you have the correct username and server address
ssh -D 8080 -C -N -i /path/to/your/server.pem email@example.com
2. Now that you have a port forward running you need to configure your Charles Proxy to also forward it’s traffic via this config, do this using “External Proxy Settings”
3. Your proxy should no be listening on the port you setup e.g. port 8888 by default on Charles. Now configure your iOS or other device to point to the OS X device setup in step 1 as the proxy server. http://www.charlesproxy.com/documentation/faqs/using-charles-from-an-iphone/
If you are like me and do a lot of work on different devices and need to debug what is going on this little trick can be invaluable. This only takes 3 mins to setup and is invaluable.
Tools you will need:
- An OS X based machine (as all good multi device developers should have, could also be done on linux)
- A device
- A Copy of Charles Proxy (also an essential tools for developers - http://www.charlesproxy.com/
- A wifi or fixed network with both devices on the network
What we are going to do is setup the OS X machine to be a router and forward any traffic that is on port 80 and 443 to the Charles Proxy and make sure that Charles has transparent proxy mode enabled. Note that without the SSL certs installed on the devices for the proxy you may need to drop the 443 forwarding.
- Enable IP forwarding:
sudo sysctl -w net.inet.ip.forwarding=1
- Place the following two lines in a file called, say, pf.conf:
rdr on en2 inet proto tcp to any port 80 -> 127.0.0.1 port 8080
rdr on en2 inet proto tcp to any port 443 -> 127.0.0.1 port 8080
These rules tell pf to redirect all traffic destined for port 80 or 443 to the local mitmproxy instance running on port 8080. You should replace en2 with the interface on which your test device will appear.
- Configure pf with the rules:
sudo pfctl -f pf.conf
- And now enable it:
sudo pfctl -e
Note I borrowed this form mitmproxy proxy which I will definitely be trying out as sounds like my kind of proxy even though Charles is handy for the formatted JSON/XML views: mitmproxy
Now you need to configure only the default gateway of your device to point at the interface on your OS X machine. Note that on my Macbook using wifi that looks like this:
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1453
inet6 fe80::22c9:d0ff:fe49:9831%en0 prefixlen 64 scopeid 0x4
inet 10.33.195.97 netmask 0xffffffc0 broadcast 10.33.195.127
The last bit is you need to set Charles in Transparent Proxy mode:
And then with some luck like I had it all works first time and I now have an LG TV that doesn’t support proxy settings working through my proxy in <5 mins without any special hardware.