[fpc-pascal] embedded HTTP server in GUI application

Michael Van Canneyt michael at freepascal.org
Tue Sep 3 09:36:14 CEST 2013



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.



More information about the fpc-pascal mailing list