Page 15 of 23
Re: Webserver
Posted: Sun Jun 19, 2016 9:25 am
by Pako
Jabberwock wrote:Is the plugin capable of handing a websockets server with a specific URL, e.g.: ws://<ip address>:9999/qlcplusWS ?
Unfortunately, I'm not sure how it is meant.
Webserver plugin has to act as a WebSocket client or as WebSocket server?
Pako
Re: Webserver
Posted: Tue Aug 16, 2016 9:38 pm
by Sem;colon
I've done some work on Webserver plugin.
Any errors are corrected, some new actions are added.
I tested it for some time, but it's not enough.
So far, we call it an experimental version.
I ask all users (who use the Webserver plugin) for thorough testing!
I can't find any issues (I still don't use websockets though)
Re: Webserver
Posted: Tue Oct 04, 2016 11:26 am
by Aquila
Hi!
I have been using this plugin with no problem for a long time now. I just upgraded my iPhone to iOS10, and on that phone websockets does not work. It still works on other devices (even iOS9 devices). So the problem is with iOS10. I've been googling the problem, but I can't find an answer that fixes my problem. There has to be some change in how iOS10 uses websockets, but I'm not able to find out what. Anyone have a clue?
Re: Webserver
Posted: Thu Oct 06, 2016 1:59 am
by m19brandon
Aquila wrote:Hi!
I have been using this plugin with no problem for a long time now. I just upgraded my iPhone to iOS10, and on that phone websockets does not work. It still works on other devices (even iOS9 devices). So the problem is with iOS10. I've been googling the problem, but I can't find an answer that fixes my problem. There has to be some change in how iOS10 uses websockets, but I'm not able to find out what. Anyone have a clue?
I am at a loss too. I thought is was a CSP meta tag thing but I cannot get it working and it works everywhere else outside of iOS10
https://github.com/meteor/meteor/issues/7772
From other forums, I think that the iOS10 WebKit blocks all ws connections. I am going to try wss this weekend but I need to create a cert.
Re: Webserver
Posted: Thu Oct 06, 2016 7:19 am
by Aquila
I've also been playing with the CSP header, but can't get any changes.
I found this:
https://java.net/jira/browse/TYRUS-432
If the webserver plugin has the same behaviour, that could explain the disconnect and be easy to fix if one knows where to look.
Re: Webserver
Posted: Thu Oct 06, 2016 10:16 pm
by m19brandon
No luck last night for me either.
I tried adding the cert, so with https and the js posting to wss:, I still get it working on iOS10 but I did get an error in EG now. In the browser I get 1006.
Code: Select all
2016-10-05 23:14:48 NOTICE: Websocket closing: GOING_AWAY
2016-10-05 23:14:48 EVENT: HTTP.WsClientDisconnected [('192.168.1.203', 49558)]
2016-10-05 23:14:48 INFO: ----------------------------------------
2016-10-05 23:14:48 INFO: Exception happened during processing of request from ('::ffff:192.168.1.203', 49559, 0, 0)
2016-10-05 23:14:48 ERROR: Traceback (most recent call last):
2016-10-05 23:14:48 ERROR: File "SocketServer.pyc", line 599, in process_request_thread
2016-10-05 23:14:48 ERROR: File "SocketServer.pyc", line 334, in finish_request
2016-10-05 23:14:48 ERROR: File "SocketServer.pyc", line 657, in __init__
2016-10-05 23:14:48 ERROR: File "SocketServer.pyc", line 716, in finish
2016-10-05 23:14:48 ERROR: File "socket.pyc", line 282, in close
2016-10-05 23:14:48 ERROR: AttributeError: 'NoneType' object has no attribute 'close'
2016-10-05 23:14:48 INFO: ----------------------------------------
2016-10-05 23:14:48 EVENT: HTTP.20160924 []
Re: Webserver
Posted: Fri Oct 07, 2016 12:41 am
by m19brandon
Aquila wrote:I've also been playing with the CSP header, but can't get any changes.
I found this:
https://java.net/jira/browse/TYRUS-432
If the webserver plugin has the same behaviour, that could explain the disconnect and be easy to fix if one knows where to look.
I am not I fully understood that java.net problem reported.
I tried this
https://www.websocket.org/echo.html page my EG Webserver.
If I point to ws://echo.websocket.org/ it works.
If I point to EG Webserver ws://192.168.1.203:8080/ws it fails.
It must be something in the python response somewhere that iOS10 does not like.
Re: Webserver
Posted: Tue Oct 18, 2016 9:54 am
by eirik226
I have a Synology NAS home - this is a network storage device and it has the ability to host a webpage and make it available outside your network, I was wondering if it's possible to host the webpage I have created for eventghost on this device?
Re: Webserver
Posted: Tue Oct 25, 2016 2:27 am
by m19brandon
eirik226 wrote:I have a Synology NAS home - this is a network storage device and it has the ability to host a webpage and make it available outside your network, I was wondering if it's possible to host the webpage I have created for eventghost on this device?
Yes, it should be just html and js files but you would lose all the EG functional.
Why not port forward to your EG machine from your router?
https://portforward.com/router.htm
Re: Webserver
Posted: Sat Oct 29, 2016 10:08 pm
by Sem;colon
Hi Together,
I created a new version of the plugin, this version includes:
-All the changes in 3.12.1
-The changes made to version 3.12 on github to support EG 0.5
-Some fixes for the function "Send event to another webserver" - it never did GET requests, always POST. Now it performs a GET if the parameter "Event" is not specified.
@Pako: All the "experimental" changes from 3.12.1 are in here, I didn't test most of them, so I leave it to you to make a request on github or something to integrate it in the next version of EG or not. Just in case you want to change something.
Re: Webserver
Posted: Tue Nov 01, 2016 4:38 am
by mbonaccors
Hi all,
I have tested the simplest websocket connection html in order to understand why connections in iOS 10 are not happening.
On Desktop Chrome, IE, Firefox etc. The websocket connection works absolutely fine. On iOS 10 Safari it shows the following error message in the safari dev console when trying to connect:
WebSocket connection to 'ws://eventghostwebserver' failed: Invalid HTTP version string: HTTP/1.0
I get this regardless of the HTML that I am running - could this be something regarding the webserver plugin itself? At a bit of a loss on what the issue could be.
Re: Webserver
Posted: Thu Nov 03, 2016 1:32 am
by m19brandon
Thanks @mbonaccors for the information, you figured it out!!
Python's BaseHTTPServer defaults to HTTP 1.0 to support backwards compatibility. I must have missed that error when debug earlier this month.
I was able get WebSockets on IOS10 working by adding one line of code to the plugin.
Please add "self.protocol_version = 'HTTP/1.1'" to __int__.py at line 1166 and restart EG. It should now work.
Code: Select all
except:
eg.PrintTraceback()
self.protocol_version = 'HTTP/1.1' #<<< Add this to line 1166
self.send_response(101, 'Switching Protocols')
self.send_header('Upgrade', 'websocket')
self.send_header('Connection', 'Upgrade')
self.send_header('Sec-WebSocket-Accept', str(digest))
self.end_headers()
self.protocol = 0
Pako and Sem;colon if this works can we get this added to the next version?
mbonaccors wrote:Hi all,
I have tested the simplest websocket connection html in order to understand why connections in iOS 10 are not happening.
On Desktop Chrome, IE, Firefox etc. The websocket connection works absolutely fine. On iOS 10 Safari it shows the following error message in the safari dev console when trying to connect:
WebSocket connection to 'ws://eventghostwebserver' failed: Invalid HTTP version string: HTTP/1.0
I get this regardless of the HTML that I am running - could this be something regarding the webserver plugin itself? At a bit of a loss on what the issue could be.
Re: Webserver
Posted: Mon Nov 07, 2016 2:43 pm
by mbonaccors
@m19brandon thank you for the help also! I added your line of code and my webapp is now working perfectly. Good teamwork!
Glad we were able to make it past this issue - cheers!
Re: Webserver
Posted: Thu Nov 17, 2016 10:52 am
by davidmark
Plug-in decodes using "latin1" instead of the standard "utf-8".
viewtopic.php?f=4&t=9455
There is already a pull request pending review:
https://github.com/EventGhost/EventGhost/pull/116
...though no idea how long that will take. Change is a single string and is as obvious as it is critical. Was ready to dump the Web server a few months back due to related issues and a lack of motivation to delve into the plug-in code. In hindsight, I should have looked as soon as I noticed the exceptions.
Have to ask why this code is being maintained here as opposed to Github. The repository is apparently owned by "Blackwind". Are they still around or are pull requests a waste of time?
As a side note, the Broadcaster plug-in has a similar issue and need somebody to finish what I started here:
viewtopic.php?f=4&t=8222
...As noted, I'm not a real Python programmer and have neither the time nor inclination to become one. I can fix bugs, but can't stand using this BB forum (or wasting time on an untended repository). The forum often times out and loses my replies; have to remember to copy longer posts to the clipboard before sending. Can there be any doubt this project needs a unified (and stable) home to move forward? Saw a thread about the various factions, but I haven't got time to catch up on all that.
Thanks and best of luck!
Re: Webserver
Posted: Thu Nov 17, 2016 6:16 pm
by kgschlosser
i believe this issue needs to be fixed at the core for triggered events. i will make the repair and send the information over to the powers that be and see if it will get added... the reason why i think it needs to be fixed at the core is because it's really an issue related to the TriggerEvent and also having to go through all of the plugins to correct it a much larger undertaking and it will also take care of any possible problems that can arise from this issue...
but now others know what the issue is and how to fix it..
TY