#1 2015-04-28 22:33:27

moctes
Member
From: Mexico
Registered: 2013-05-11
Posts: 129

Interface based Server on Lazarus + FPC + HTTPS

Hi to all,

I know that support for Lazarus + FPC is not finished yet, but I'm looking more seriously to use FPC for my server code, and although I'm still coding 100% on Delphi + Windows I was wondering if I can have a server compiled with FPC to replace an existing interface based server which is serving https requests on a windows machine, so my questions are :

1. Can I serve https requests on Windows with a FPC + mORMot compiled binary ?  I guess it has the same http.sys kernel-mode server support but I'm interested to hear experiences from others

2. Can I have a similar setup on Linux (I mean serving https requests) ?

3. If answer to number 2 is no, how far do you think is mORMot from doing same task on Linux ?  ( I'll be just fine with windows, but I'm looking forward to linux server support )

Thank you

Offline

#2 2015-04-28 22:43:43

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Interface based Server on Lazarus + FPC + HTTPS

1. Support is the same for http.sys.

2 and 3. Use a front head, e.g. nginx, and our socket based server.
This is a very common and efficient, safe solution under Linux.
Pretty close to the http.sys design under Windows, in fact...

Offline

#3 2015-04-28 23:05:39

moctes
Member
From: Mexico
Registered: 2013-05-11
Posts: 129

Re: Interface based Server on Lazarus + FPC + HTTPS

Thank you Arnaud smile , I think we can go Windows first and following your advice I'll begin to research on the linux side of things later

Offline

#4 2015-04-29 07:48:29

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Interface based Server on Lazarus + FPC + HTTPS

ab wrote:

2 and 3. Use a front head, e.g. nginx, and our socket based server.
This is a very common and efficient, safe solution under Linux.

AB, Can you point me to the corresponding paragraph in the document on the details of such setup? I mean, how a mORMot-powered web app works together with Nginx? Maybe you mean the mORMot-powered binary works as a REST API server, and the JS inside HTML pages (served by NginX) communicate with the mORMot server with Ajax?

Last edited by edwinsn (2015-04-29 07:50:49)


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#5 2015-04-29 09:30:40

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Interface based Server on Lazarus + FPC + HTTPS

There is nothing in the mORMot documentation (yet) on this particular point.
But this is clearly explained in the nginx related websites.

You use nginx as a HTTPS proxy front-end, communicating with the mORMot HTTP server running on a local port.
See for instance http://www.cyberciti.biz/faq/howto-linu … ssl-proxy/
and https://www.digitalocean.com/community/ … untu-14-04
and https://www.digitalocean.com/community/ … or-jenkins

Offline

Board footer

Powered by FluxBB