Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
Tornado (webserver with WebSocket)
Re: Tornado (webserver with WebSocket)
Hi Pako,
This is awesome, i've been wanting to make/have something like this.
Hopefully in the near future I can use this to integrate the Insteon plugin and my SONOS plugin to have a web interface. Ultimately it can allow me to create a GUI for my home control and status.
Thanks for the great work!
This is awesome, i've been wanting to make/have something like this.
Hopefully in the near future I can use this to integrate the Insteon plugin and my SONOS plugin to have a web interface. Ultimately it can allow me to create a GUI for my home control and status.
Thanks for the great work!
The Latest SONOS Plugin:
Latest version can be found here: http://eventghost.org/forum/viewtopic.p ... 05f#p30309
EventGhost Lets me automate my home the way I want it, I love using it!
Latest version can be found here: http://eventghost.org/forum/viewtopic.p ... 05f#p30309
EventGhost Lets me automate my home the way I want it, I love using it!
Re: Tornado (webserver with WebSocket)
Pako and community...
While this is very cool, many of us have a multi-faceted home theater and home automation. And every app seems to have its own web UI - which makes things very disjointed. I'm not a fan of customer building everything from scratch, it has bit me too many times when apps change APIs, etc.
My suggestion...
Utilize what Pako has built and integrate into an existing framework that is being actively developed and already has MANY other apps fully integrated.
There are a few but the most actively developed is HTPC Manager...
http://htpc.io
... which already has XBMC, Sick Beard, SABnzbd, CouchPotato, Transmission -- and adding others like Deluge, NZBget, etc
Anyway, I'd love to see an EventGhost module for HTPC Manager so I can have an integrated UI for launching Macros.
I just don't see a reason/need to yet another Web framework when so many others already exist and are well supported.
While this is very cool, many of us have a multi-faceted home theater and home automation. And every app seems to have its own web UI - which makes things very disjointed. I'm not a fan of customer building everything from scratch, it has bit me too many times when apps change APIs, etc.
My suggestion...
Utilize what Pako has built and integrate into an existing framework that is being actively developed and already has MANY other apps fully integrated.
There are a few but the most actively developed is HTPC Manager...
http://htpc.io
... which already has XBMC, Sick Beard, SABnzbd, CouchPotato, Transmission -- and adding others like Deluge, NZBget, etc
Anyway, I'd love to see an EventGhost module for HTPC Manager so I can have an integrated UI for launching Macros.
I just don't see a reason/need to yet another Web framework when so many others already exist and are well supported.
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
Re: Tornado (webserver with WebSocket)
Does tornado support php? The other webserver plugin dont seem to.
My problem is that i want to get info from xbmc json-rpc, but i cant do an ajax request as it gives same-origin-policy error. so i was able to set a php proxy page (the php page fetches the data from xbmc, as it is serverside script it dont get same-origin-policy error) then i use ajax request to get the data from the proxy page.
However it dont seem like the eventghost webservers support php...
Does tornado have any kind of server side scripting? so that i can make a proxypage somehow?
i basicly want a proxy page with this functionality:
What this means is i can use the proxy page like: myWebserver.com/proxy.php?&requrl=www.google.com
And this would get the data from the requrl (www.google.com) and show it to me.
My problem is that i want to get info from xbmc json-rpc, but i cant do an ajax request as it gives same-origin-policy error. so i was able to set a php proxy page (the php page fetches the data from xbmc, as it is serverside script it dont get same-origin-policy error) then i use ajax request to get the data from the proxy page.
However it dont seem like the eventghost webservers support php...
Does tornado have any kind of server side scripting? so that i can make a proxypage somehow?
i basicly want a proxy page with this functionality:
Code: Select all
<?php
$file = file_get_contents($_GET['requrl']);
echo $file;
?>And this would get the data from the requrl (www.google.com) and show it to me.
Re: Tornado (webserver with WebSocket)
is there realy no way of doing this?
Should i abandon my wishes to control and get data from xbmc with my tornado webserver completly?
i got tornado running on localhost:8085 and xbmc on localhost:8083,
Why cant i do ajax requests from tornado to xbmc, they are on the same computer why does it give same origin-policy-error?..
the url works when posted in a browser, but when fetched with ajax it doesn't work? why cant javascript emulate the browser request?
I've been looking for a solution over a week now and there just dont seem to be any way to get it to work?
Should i abandon my wishes to control and get data from xbmc with my tornado webserver completly?
i got tornado running on localhost:8085 and xbmc on localhost:8083,
Why cant i do ajax requests from tornado to xbmc, they are on the same computer why does it give same origin-policy-error?..
the url works when posted in a browser, but when fetched with ajax it doesn't work? why cant javascript emulate the browser request?
I've been looking for a solution over a week now and there just dont seem to be any way to get it to work?
Any chance to get HTTPS / SSL?
Hi Pako.
Would it be possible to add HTTPS support into this plugin?
I'm a newbie in Python. did some research and found some info like http://www.piware.de/2011/01/creating-a ... in-python/
Someone also suggested using Request: viewtopic.php?f=2&t=5956&p=29139&hilit=https#p29134
I'd really love that because I'd like to trigger events remotely and securely from outside my home. I'd turn Air Conditioner on before I get home for instance
Thanks for such a great plugin!!
Would it be possible to add HTTPS support into this plugin?
I'm a newbie in Python. did some research and found some info like http://www.piware.de/2011/01/creating-a ... in-python/
Someone also suggested using Request: viewtopic.php?f=2&t=5956&p=29139&hilit=https#p29134
I'd really love that because I'd like to trigger events remotely and securely from outside my home. I'd turn Air Conditioner on before I get home for instance
Thanks for such a great plugin!!
Re: Any chance to get HTTPS / SSL?
Hi again.
I just read Tornado documentation and managed to modify the plugin to require SSL connections.
You must add to the import section:
And then replace self.http_server = tornado.httpserver.HTTPServer(self) by:
Now you need to create your self-signed certificate. You'll need OpenSSL installed. I followed the 4 first steps of this guide: http://www.akadia.com/services/ssh_test ... icate.html
As stated in Step 2, make sure the Common Name matches the URL of your server.
Then copy server.crt and server.key to the main EventGhost folder (where Eventghost.exe resides). That's all.
If you don't want your browser to complain about untrusted certificate, install server.crt in Local computer > Trusted root certification authorities store
It would be nice to add the ability to choose wheter you want SSL or not in the plugin config tab, and also be able to select the cert files via a filepicker.
Also being able to start server in two different ports (SSL and No-SSL) would be great, so you could use https or http at will...
Pako, are you planning to improve this plugin or are you focused in the Webserver that comes with EventGhost?
I've been trying to add SSL to that one too, but as I said I'm a newbie in Python and I haven't succeeded so far. The plugin uses sockets and threads, and I'm a bit lost.
I guess you must use ssl_wrapper (http://docs.python.org/2/library/ssl.html) Don't know where in the code should I add ssl.wrap_socket function. Any help?
Best regards.
I just read Tornado documentation and managed to modify the plugin to require SSL connections.
You must add to the import section:
Code: Select all
import sslCode: Select all
self.http_server = tornado.httpserver.HTTPServer(self,
ssl_options=dict(
certfile="server.crt",
keyfile="server.key",
cert_reqs=ssl.CERT_NONE))
As stated in Step 2, make sure the Common Name matches the URL of your server.
Then copy server.crt and server.key to the main EventGhost folder (where Eventghost.exe resides). That's all.
If you don't want your browser to complain about untrusted certificate, install server.crt in Local computer > Trusted root certification authorities store
It would be nice to add the ability to choose wheter you want SSL or not in the plugin config tab, and also be able to select the cert files via a filepicker.
Also being able to start server in two different ports (SSL and No-SSL) would be great, so you could use https or http at will...
Pako, are you planning to improve this plugin or are you focused in the Webserver that comes with EventGhost?
I've been trying to add SSL to that one too, but as I said I'm a newbie in Python and I haven't succeeded so far. The plugin uses sockets and threads, and I'm a bit lost.
I guess you must use ssl_wrapper (http://docs.python.org/2/library/ssl.html) Don't know where in the code should I add ssl.wrap_socket function. Any help?
Best regards.
Re: Tornado (webserver with WebSocket)
Hello leothlon,leothlon wrote:is there realy no way of doing this?
Should i abandon my wishes to control and get data from xbmc with my tornado webserver completly?
i got tornado running on localhost:8085 and xbmc on localhost:8083,
Why cant i do ajax requests from tornado to xbmc, they are on the same computer why does it give same origin-policy-error?..
the url works when posted in a browser, but when fetched with ajax it doesn't work? why cant javascript emulate the browser request?
I've been looking for a solution over a week now and there just dont seem to be any way to get it to work?
I'm not sure if it helps, but did you ever check out the webserver/Tornado function "send event to another webserver"?
This function can send a post request to any webserver and returns the answer.
Re: Tornado (webserver with WebSocket)
But if i'm not mistaken that means your webserver needs to trigger an event in eg, then eg needs to execute an send event to another webserver, get the data from that webserver, then send it back to my page with websocket?... that's quite a chain... not to mention all the different combinations that would be needed based on if its tvshows, seasons, episodes, movies, music or other that i am requesting info about..
Re: Tornado (webserver with WebSocket)
well, but you can trigger this function by using "ExecuteScript" from your ajax request to EG directly.
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Any chance to get HTTPS / SSL?
Thank you for the interesting suggestion.regystro wrote:Pako, are you planning to improve this plugin ...
I'll deal with it and hope that I will find a solution.
Pako
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Any chance to get HTTPS / SSL?
I just published an upgrade of the plugin (download in the opening post).
Plugin can now work with a secure protocol (https://).
Otherwise, it will used unsecured protocol http://.
Pako
Plugin can now work with a secure protocol (https://).
If both fields contain a path to the valid file, it will be used https:// protocol.regystro wrote:It would be nice to add the ability to choose wheter you want SSL or not in the plugin config tab, and also be able to select the cert files via a filepicker.
Otherwise, it will used unsecured protocol http://.
This would be very complicated and also unnecessary. If someone wants to provide for such a possibility, simply start the two servers. One with secure protocol and one with unsecure protocol.regystro wrote:Also being able to start server in two different ports (SSL and No-SSL) would be great, so you could use https or http at will...
Pako
Re: Tornado (webserver with WebSocket)
Does this webserver support PHP, ASP, ASP.NET, or JSP? I didn't find any of those terms by searching this thread. I'm trying to figure out if it will support Ookla Speedtest Mini. Thanks.
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Tornado (webserver with WebSocket)
No. Sorry to disappoint you.kkl wrote:Does this webserver support PHP, ASP, ASP.NET, or JSP? I didn't find any of those terms by searching this thread. I'm trying to figure out if it will support Ookla Speedtest Mini. Thanks.
Those two plugins (Webserver and Tornado) are a little different from the "normal" servers. You can not expect from them the same capabilities as from others (such as Apache).
It would certainly be possible to implement support for any of these languages.
But I personally do not intend to deal with it. I think it does not make sense. That would be completely out of frame for which they are intended.
Pako
Re: Tornado (webserver with WebSocket)
Thanks very much for the quick answer.Pako wrote:No.
-
m19brandon
- Experienced User
- Posts: 177
- Joined: Mon Feb 03, 2014 10:36 pm
Re: Tornado (webserver with WebSocket)
Enjoying this plugin greatly. I have a nice remote for my family room built using it with lots of jquery for css stuff. Works great on my two Androids and PCs but my main phone is an iPhone and iPhones like to disconnect the Wifi when locked. This is javascripting problem versus the plugin and was looking for some pointers. How can I correctly close the websocket connection when the screen locks. Right now I have refresh the page when I unlock the device to use the page again. T
