Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
Hm, well it works for me without headers. I do "telnet 192.168.1.xxx 8060" and then enter "POST /launch/12 HTTP/1.1" followed by two newlines, and I get a 200 OK response. But there's certainly no harm in adhering to the spec by sending the Host header.
I've been using both VB and even AutoIt, from/on a PC (XP and Vista). I should note that I also compiled and ran the sample SDK program related to ECP (it uses HTTP 1.0). One thing I noticed with it was that where it does a get/apps the response contains no apps. It gets the header part of the repsonse message back fine, and shows an appropriate number of bytes that should be in the message body. But there is no message body (ie. there's the header , but no data).
A strange thing is that I had not been using the additional header in POSTs (or GETs). Keypress seemed to work without it. Get/apps had random problems, sometimes there'd be a usable response - sometimes not. But when I got to trying to launch apps nothing worked until I added the additional HOST: header. Now I've gone back and added the header to eveything I do (except the SSDP Discovery of course). That's seems to have produced reliable exchanges.
For my Philips pronto 9400 remote here is the script that I use. I have a page on my remote that shows my "favorites", In each button I call the function:
roku_launch(11); //where the value is the id of the channel.
In the activities page I store the actual function :
function roku_launch(channel) { //System.print(channel); var url = CF.widget("aURL","PARAMETERS").label; var timeout = CF.widget("aTIMEOUT","PARAMETERS").label; var socket = new TCPSocket(true); socket.connect(url, 8060, timeout); socket.write("POST /launch/"+channel+ " HTTP/1.1\r\n\r\n"); socket.close(); }