- Provide a web server to serve up your modified content.
- Create a web proxy server to redirect access to your web server.
- Point your Panasonic device to your web proxy.
- Download and host content from Panasonic's Viera Cast servers and modify them to your needs. This will be covered in the next post.
The web server I use is Apache 2. For development purposes I'm using a bog-standard out-of-the-box installation. In Ubuntu this serves pages from /var/www on port 80.
The web proxy I'm using is Squid (default port 3128). I modified this slightly (by editing /etc/squid/squid.conf) to minimize the footprint as follows: -
- Add "http_access allow all" (bad practice but this is development in my own home - You need to add something that lets your TV/device and development PC access the proxy).
- Add "cache_dir null /tmp" and "maximum_object_size 0 KB" (to disable disk cache - we only care about the URL redirection features so this saves space).
- Add "useragent_log /var/log/squid/useragent.log" (the reason will become clear soon).
- Add "url_rewrite_program /etc/squid/mirror_and_redirect.sh" (this points to a redirect script we will create)
while read url rest; do
filename=`echo $url | sed 's^http://^^g' | sed 's^?.*^^g'`
if [ -f /var/www/$filename ]; then
# We found a matching local file to replace, so redirect to it and log the redirect.
echo "http://localhost/$filename" >> /var/log/squid/mirror_and_redirect.log
# No match, so don't modify the URL and log the URL.
echo "$url" >> /var/log/squid/mirror_and_redirect.log
The purpose of this script is a follows. Every HTTP request passed via our proxy is parsed by the script and compared against the contents of /var/www. If a matching file exists then it adds a redirect to http://localhost/our_replacement_file to redirect the client (i.e. the Panasonic device) to our local modified file. It logs all this information to mirror_and_redirect.log so we can see what's been served locally and what's been passed through.
Finally I configured my TV to access the web via the proxy. On my Panasonic G20 Plasma this is accessed under Menu...Setup...Network Setup...Proxy Settings. I set the address to the IP address of my Ubuntu server and port to 3128 (Squid). How you do yours depends on what you've got. If you can't figure it out, you probably shouldn't go any further :D
Assuming Squid is now working, Viera Cast should work as normal on your device. And now the fun begins...