Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-09

embedded HTTP server in GUI application

6 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

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

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 15 lines
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 ?

Show quoted text 6 lines
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.

Marco van de Voort
to Graeme Geldenhuys: Can anybody make recommendations for embedding a HTTP Server into a GUI application? ps:…

In our previous episode, Graeme Geldenhuys said:

Show quoted text 5 lines
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.

Michael Van Canneyt
to Marco van de Voort
Marco van de Voort wrote 9 lines
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.

Ludo Brands
to Michael Van Canneyt: IMHO, there is no hate, but it's simply overly complicated for many use-cases. Michael.
Michael Van Canneyt wrote 18 lines
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