Page 6 of 23

Re: Webserver

Posted: Thu May 01, 2014 6:26 pm
by Pako
I have a hunch that you are looking for problems where there are none.
You probably wrong doing testing.
Try it otherwise.

Pako

Re: Webserver

Posted: Thu May 01, 2014 6:45 pm
by Sem;colon
Hi Pako, thanks for the quick reply!

yes your solution works well in this example, but it's not the solution I'm looking for. :)
I just wanted to show you with the example that the webserver stops processing requests after the 6t ongoing request.

Background of the question is that I have some time consuming requests from the fronted that aims to retrieve data from the result of an eventghost function. (like searching the server HDD file system for a specific file)
In my example a left out the callback function to simplify it, but in my set-up there is one!

And I experienced recently in my setup that 6 at a time sometimes are not enough.

...sorry for not mentioning that

Re: Webserver

Posted: Fri May 02, 2014 6:55 am
by Pako
Hi Sem;colon !
Yes, you're right and I apologize.
I was the one who improperly tested (I'm not complied with the condition "This page creates a new never ending request ...").
However - I think that the problem is not on the side of the webserver, but on the browser.
I found interesting information on the Web: "Per the HTTP RFC, a client should not maintain more than 2 simultaneous connections to a webserver or proxy. However, most browsers don't honor that - firefox 3.5 allows 6 per server and 8 per proxy."
For example the using UC Browser (Android) I got to 7 simultaneous requests.
Have you tried to use multiple computers at once?

Pako

Re: Webserver

Posted: Fri May 02, 2014 7:54 am
by Sem;colon
Hi Pako,

thank you for that information, I didn't even thought about something like that!
Yes, I tested it with Firefox and chrome on two different PCs - per Browser it was limited to 6. You can even open two browser windows on the same PC and you get 6 simultaneous requests each.

I just now checked out InternetExplorer - this one seems to do 12 requests...

Well, looks like I have to change something in the frontend, queueing the requests for example.

Thank you for your help!

Re: Webserver

Posted: Mon Aug 11, 2014 11:57 am
by TRIROG1
Quick question:
I have a variable {{eg.globals.Weather_Temp}} that changes every 30 seconds

What i would like to do is display this variable on my web page and have it refresh every 30seconds without reloading my page?

Is this possible?
Could anyone post an example?

I tried with

Code: Select all

<head>
<script src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
		setInterval(function() {
					$('#temperature').text(
						{{eg.globals.Weather_Temp}});
                }, 3000);
});
</script>
</head>
<body>
<div id="temperature">
</div>
</body>
</html>
but the variable was only refreshing on reload?

What am i doing wrong?

Re: Webserver

Posted: Mon Aug 11, 2014 1:00 pm
by krambriw
I would recommend you to look at the Tornado plugin and specifically the websocket support.
BestR Walter

Re: Webserver

Posted: Mon Aug 11, 2014 5:38 pm
by TRIROG1
Hmmm ... will take a look ... on first look though it's currenty a no-go since the latest version requires v 1669, with which i have problems loading config file on startup - see my bug report ...

perhaps an earlier version ...

Any other ideas/suggestions

Re: Webserver

Posted: Mon Aug 11, 2014 6:31 pm
by krambriw
No, no, you do not need latest version to run Tornado and websockets, you can install an earlier version and add the plug manually from the plugin post. I have no probs providing html and python samples to you once you updated yourself a bit on the subject.

Also, I made some postings earlier how to use the normal WebServer plugin together with the WebsocketSuite plugin. This combination still works perfect, I actually run them in parallel for the moment. You find the posts here:
http://eventghost.net/forum/viewtopic.p ... ket#p22070

So there are two choices, either go with the newer Tornado that has built in support for websockets or use the older combo.

Best regards, Walter

Re: Webserver

Posted: Mon Aug 11, 2014 10:02 pm
by TRIROG1
Hey! Thanks!

Just to make things clear . C

There are
Webserver...plugin for web server that does not support websocket.
Websocketsuite ... plugin to work alongside the webserver plugin (need both) and add the websocket functionality.
Tornado ... Plugin that is a webserver with websocket support - replaces websocketsuite and webserver ?

Correct?

Re: Webserver

Posted: Tue Aug 12, 2014 4:08 am
by krambriw
Correct, yes

Re: Webserver

Posted: Sun Nov 16, 2014 12:48 pm
by Pako
I added WebSocket support for this plugin. This is an experimental version.
It should be completely backward compatible, and it can completely replace Tornado plugin.
It only supports WebSocket protocol number 13.
Secured communication (https:// and wss://) is also supported.
Here is an example of creating WebSocket on the client side:

Code: Select all

    var prot = "";
    var ip = location.host;
    if (location.protocol == "https:") {
        prot = "wss://";
    }
    else {
        prot = "ws://";
    }
    //var wSocket = new WebSocket(prot + ip + "/ws"); //mandatory for Tornado
    var wSocket = new WebSocket(prot + ip); //enough for Webserver
Please test!
Pako

Re: Webserver

Posted: Thu Nov 20, 2014 5:32 am
by Pako
No opinion ?
Something is wrong ?

Re: Webserver

Posted: Thu Nov 20, 2014 9:29 am
by Sem;colon
I think that's very cool!!
I just didn't have a Chance to test it, I will do that at the Weekend and give you some feedback. 8)

Re: Webserver

Posted: Sat Nov 22, 2014 9:50 am
by Sem;colon
Hi Pako,

I just tested version 3.1 - as far as I can tell it runs perfect! (at least the old functions, I didn't test the websocket stuff yet)
Good job! Like always ;)

I also made a small modification to version 2.1 I never released but it turned out to be very useful.
I'm heavily using the "ExecuteScript" function, but as this function is not raising an exception in EventGhost, my calls were very hard to debug.
So, my modification more or less just raises the exception...

I attached a 3.1 with this little modification.

Re: Webserver

Posted: Sat Nov 29, 2014 8:37 pm
by Sem;colon
...I'd like to report a bug:
Since version 3.0 the "Send event to another EventGhost" function is not working any more