[Gambas-user] Gambas called by a Web Server

Benoît Minisini g4mba5 at gmail.com
Tue May 21 15:13:32 CEST 2019

I suggest not to use 'gb.httpd' for production applications. It was just 
an hack made for debugging web applications. My two cents.

Le 21/05/2019 à 15:08, Cedron Dawg a écrit :
> Thanks Christof and Tobi,
> I'm just in the exploratory stage of this now.  It is good to know
> that I should be able to use the same code that I am producing the
> static HTML reports with to serve up dynamic web pages.
> I am pretty sure I am heading in the third direction, without any
> hacking.  It is important that I be able to easily and efficiently
> maintain persistent sharable application and session level objects.
> In the early days of web servers, I wrote a C based CGI relay program
> which communicated to a running VB3 (or 4) via a file passing
> protocol.  The same method should work here using a PHP relay and a
> TCP connection.  There are other advantages too.
> I'm almost done with the new class report files.  I'll be posting the
> code soon.
> Ced
> ----- Original Message ----- From: "Tobias Boege"
> <taboege at gmail.com>
> The merit of a script is that it's slightly easier to deploy I would
> say. The great disadvantage of Gambas scripts is that you're
> effectively limited to a single class in your project. If you look at
> the Gambas Wiki program, it uses multiple classes and even Webpages
> [1] which clearly beat Print- based CGI.
> Concerning performance, you should know that the scripter is just a
> Gambas program that takes your script, builds a proper project
> directory structure around it, which gets compiled, *caches that* at
> least, and then has it run. The overhead of looking the compiled
> executable up in the cache and having to start the regular
> interpreter anyway makes it even slightly worse than having a normal
> project.
> For me, all signs point at writing a full project and running its
> executable.
> But there's a third way: an application server. When I lived in the
> student dorms, where my friends and I had a shared network, I used to
> run a bigger Gambas program for us based on gb.web.form under
> gb.httpd which was reverse- proxied by nginx. gb.httpd is sort of
> building a web server into your Gambas program. On each new HTTP
> request, the server parses it, sets up variables, then forks and
> longjmp's into the host Gambas program to handle the request.
> That was in the very early days of gb.web.form and it required some
> hacking to get it all to work, but I don't remember where problems
> came up. Maybe it's simply better these days and you want to try it
> out?
> Regards, Tobi
> [1] http://gambaswiki.org/wiki/doc/webpage

Benoît Minisini

More information about the User mailing list