This gem implements the Google Anymote Protocol which is used to send events to Google TVs. The protocol is based on a client-server model, with communications based on protocol buffers. Clients search for a server on the local network. When a client wants to connect to a server it has discovered, it does pairing authentication. After a successful pairing, both the client and the server have certificates specific to the client app, and can communicate in the future without the need to authenticate again. The transport layer uses TSL/SSL to protect messages against sniffing.
Note: I couldn't have made this without Steven Le's Python client.
Add this line to your application's Gemfile:
gem 'google_anymote'
And then execute:
$ bundle
Or install it yourself as:
$ gem install google_anymote
In order to send commands to a Google TV you must have an OpenSSL certificate. This certificate can be self-signed and is pretty easy to generate. Just follow these steps (taken from http://www.akadia.com/services/ssh_test_certificate.html):
$ openssl genrsa -des3 -out server.key 1024
$ openssl req -new -key server.key -out server.csr
$ openssl rsa -in server.key -out server.key
$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
$ cat server.key server.crt > cert.pem
Use the cert.pem
as your certificate when you pair with the Google TV.
This gem includes several command line utilities to get you up and running.
- discover - searches your network for compatible Google TVs
- pair - helps you pair your computer to a particular Google TV
-
Create a GoogleAnymote::TV object
gtv = GoogleAnymote::TV.new(my_cert, hostname)
-
Fling URIs to that TV
gtv.fling_uri('http://github.com')
- Fork it
- Create your feature branch ('git checkout -b my-new-feature')
- Commit your changes ('git commit -am 'Added some feature')
- Push to the branch ('git push origin my-new-feature')
- Create new Pull Request