embedded HTTP server in GUI application

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

embedded HTTP server in GUI application

Graeme Geldenhuys-3
Hi,

Can anybody make recommendations for embedding a HTTP Server into a GUI
application?

ps: I'm using FPC 2.6.2, and the end result application will run under
Windows (primarily) and Linux.

1) My initial thought was to use Synapse. The TTCPHTTPDaemon seems
pretty simple to use, is already a component, and easily embedded in a
GUI [fpGUI] application.

2) I also looked at nYume - a very small HTTP (console) Server that
seems easy enough to convert into a "http server component", which I can
then run in a separate thread - embedded in my GUI app.

3) I understand Free Pascal also includes a HTTP Server now. I think it
is the one I found in fcl-web demos directory. It is a
TCustomApplication descendant - so will need some work to get working in
fpGUI based apps, seeing that fpGUI apps are not based on
TCustomApplication.


Anybody used any of these in any GUI environment as an embedded HTTP
server? Any pros or cons on each? Any other HTTP server components I
should maybe try?

Background info:
I need to embed the HTTP server into a GUI (desktop) application for two
products. One will be the application server in a 3-tier application
(communication is done via HTTP). The other product is a teaching
program that will launch a web browser (pointing to the embedded server)
and serving CGI apps that does the actual teaching for the student.

Regards,
  Graeme

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: embedded HTTP server in GUI application

Michael Van Canneyt


On Mon, 2 Sep 2013, Graeme Geldenhuys wrote:

> Hi,
>
> Can anybody make recommendations for embedding a HTTP Server into a GUI
> application?
>
> ps: I'm using FPC 2.6.2, and the end result application will run under
> Windows (primarily) and Linux.
>
> 1) My initial thought was to use Synapse. The TTCPHTTPDaemon seems
> pretty simple to use, is already a component, and easily embedded in a
> GUI [fpGUI] application.
>
> 2) I also looked at nYume - a very small HTTP (console) Server that
> seems easy enough to convert into a "http server component", which I can
> then run in a separate thread - embedded in my GUI app.

Have you looked at the code ?

>
> 3) I understand Free Pascal also includes a HTTP Server now. I think it
> is the one I found in fcl-web demos directory. It is a
> TCustomApplication descendant - so will need some work to get working in
> fpGUI based apps, seeing that fpGUI apps are not based on
> TCustomApplication.

Not correct. There is a component.

The TCustomApplication descendent just uses the component.
fphttpapp.pp contains the application.
fphttpserver.pp contains the component.

You can perfectly use the component. That's why I designed it like this, for use in a GUI.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: embedded HTTP server in GUI application

Marco van de Voort
In reply to this post by Graeme Geldenhuys-3
In our previous episode, Graeme Geldenhuys said:
> Can anybody make recommendations for embedding a HTTP Server into a GUI
> application?
>
> ps: I'm using FPC 2.6.2, and the end result application will run under
> Windows (primarily) and Linux.

Indy10. I know there is a lot of (IMHO baseless) hate against Indy, but it
works fine.
 
> Anybody used any of these in any GUI environment as an embedded HTTP
> server? Any pros or cons on each? Any other HTTP server components I
> should maybe try?

I used the above mostly because SSL at the time. That was Delphi, but I
ran the (HTTP server) tests etc also in FPC.
 
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: embedded HTTP server in GUI application

Michael Van Canneyt


On Tue, 3 Sep 2013, Marco van de Voort wrote:

> In our previous episode, Graeme Geldenhuys said:
>> Can anybody make recommendations for embedding a HTTP Server into a GUI
>> application?
>>
>> ps: I'm using FPC 2.6.2, and the end result application will run under
>> Windows (primarily) and Linux.
>
> Indy10. I know there is a lot of (IMHO baseless) hate against Indy, but it
> works fine.

IMHO, there is no hate, but it's simply overly complicated for many use-cases.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: embedded HTTP server in GUI application

Graeme Geldenhuys-3
In reply to this post by Michael Van Canneyt
On 03/09/13 08:36, Michael Van Canneyt wrote:
> fphttpserver.pp contains the component.
>
> You can perfectly use the component. That's why I designed it like this, for use in a GUI.


Thanks for the info Michael, I'll take a closer look at that.


Regards,
  Graeme



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: embedded HTTP server in GUI application

Ludo Brands
In reply to this post by Michael Van Canneyt
On 09/03/2013 12:09 PM, Michael Van Canneyt wrote:

>
>
> On Tue, 3 Sep 2013, Marco van de Voort wrote:
>
>> In our previous episode, Graeme Geldenhuys said:
>>> Can anybody make recommendations for embedding a HTTP Server into a GUI
>>> application?
>>>
>>> ps: I'm using FPC 2.6.2, and the end result application will run under
>>> Windows (primarily) and Linux.
>>
>> Indy10. I know there is a lot of (IMHO baseless) hate against Indy,
>> but it
>> works fine.
>
> IMHO, there is no hate, but it's simply overly complicated for many
> use-cases.
>

And the fpc port is not really maintained. A few months ago when I tried
to use the latest version of Indy on Linux, it was just hopeless.
Problems with iconv, new Delphi constructs, etc, etc. You'll find
defines for FPC but new code typically doesn't use them. I just abandoned.

Ludo

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal