Forum > Networking and Web Programming

Any really functional webserver suite for FPC ?

(1/3) > >>

zim:
Is there any really functional suite for HTTP-HTTPS available for FPC under Linux ?
Spent a week trying to make it work - no progress at all.

Indy for Delphi + SSL patch for openssl 1.1/3.0 - works perfectly. But all attempts to make it work under FPC or Lazarus fail.
Either code from my Delphi package or OPM code - not work.
Everything stops on content encoding conversion, iconv conversion returns no bytes.

Same with Synapse. Any unicode symbols in reply are returning incorrectly.

Where's that old good Kylix code...

abouchez:
Of course, I would recommend our Open Source https://github.com/synopse/mORMot2
It is a full client/server suite, and support latest OpenSSL 3.x (no need to patch anything).
It was meant to write REST/JSON services, but you can use it to serve some HTTP/HTTPS content, even with a Mustache-based template system.

With amazing performance - top #12 framework in the TemchEmpower Benchmarks - it has been deeply optimized for Linux (e.g. it uses epoll for its asynchrnous HTTP/HTTPS server, and we even wrote our own multi-thread friendly heap manager for FPC x86_64 Linux).
https://blog.synopse.info/?post/2023/10/31/Pascal-in-the-race%3A-TFB-Challenge-Benchmarks

See https://github.com/synopse/mORMot2/tree/master/ex/mvc-blog
for a MVC blog.
See https://github.com/synopse/mORMot2/tree/master/ex/ThirdPartyDemos/tbo
for some demos - for Delphi, but you can read the text (German & English), look at the code and get your idea.

There are some other frameworks too of course, for FPC.
Don't use Indy, because it is not OpenSSL 3.x ready, and not very FPC friendly.
But you have also known alternatives, like fcl-web or Brooks.

dpremus:
I am using Horse

https://github.com/HashLoad/horse

It works with Lazarus & Delphi

zim:
I finally had found the problem, better say several problems. First, fpjson unit is half-working, method TJsonObject.Find returns False even if element with the specified name is 100% available.
Next, Lazarus RC2 randomly does not recompile modified units, and no chance to make them compile but manually delete of units folder.
Lazarus itself hang or produces AV periodically

Still some strange problems with unicode - -Mdelphi make it compile (but with non-unicode strings), while -Mdelphiunicode returns strange errors cannot be explained.
Btw, I had commented some components used, as FPC produces internal error compiling them.

Thanks for the advice, will check links

PascalDragon:

--- Quote from: zim on December 19, 2023, 11:30:31 am ---First, fpjson unit is half-working, method TJsonObject.Find returns False even if element with the specified name is 100% available.
--- End quote ---

Please report a bug for this with a reproducible, small, self contained example that shows the issue.


--- Quote from: zim on December 19, 2023, 11:30:31 am ---Still some strange problems with unicode - -Mdelphi make it compile (but with non-unicode strings), while -Mdelphiunicode returns strange errors cannot be explained.
--- End quote ---

The DelphiUnicode only changes String = UnicodeString for the unit that it's compiled with. So especiallly precompiled units (like the RTL or the LCL) will not use UnicodeString for String. Essentially it is currently not recommended to use that mode. The next major release will provide a real Unicode RTL for selected targets (no, there is currently no timeframe for when it will be released). So best stay with the normal AnsiString and the UTF-8 encoding that Lazarus uses.


--- Quote from: zim on December 19, 2023, 11:30:31 am ---Btw, I had commented some components used, as FPC produces internal error compiling them.
--- End quote ---

Same as above: please provide small, self contained examples that show the issue.

If we don't know about something we can't fix it after all.

Navigation

[0] Message Index

[#] Next page

Go to full version