Recent

Author Topic: HTTPS best fpc solution?  (Read 4816 times)

Blestan

  • Sr. Member
  • ****
  • Posts: 461
HTTPS best fpc solution?
« on: April 05, 2017, 03:47:45 pm »
Hi guys?
want to start building swagger compatible API using fpc as backend.
so, the api will be defined in swagger the client stubs will be generated fot ionic2/angular
and the server will be fpc. but i need to start a https server on a digitalocean droplet using debian jessie ... witch of the net libs in freepascal are suitable for building a server with ssl enabled or may be to go for apache mod or fastcgi  and let appache deal with the ssl stuff?
thanks
« Last Edit: April 05, 2017, 03:51:00 pm by Blestan »
Speak postscript or die!
Translate to pdf and live!

john horst

  • Jr. Member
  • **
  • Posts: 68
    • JHorst
Re: HTTPS best fpc solution?
« Reply #1 on: April 05, 2017, 07:04:00 pm »
I would possibly suggest looking into brook framework, I've never used it but I did use fpweb and it kinda sucks.

If you do use fpweb, I would proxy the application with a REAL web server, Nginx Apache etc. I also used Nginx to redirect 307 redirects to have a proper 404 error page. The developer of fpweb apparently kept the developer of the application in mind, the errors that get generated by the application are annoying to deal with. If a page does not exist it should return a 404, fpweb will instead throw 400 bad request (no shit I developed it, I know its a bad request, thanks for the stack trace lol) a 400 is for methods get, post, delete etc not non existent pages. I don't think fpweb has any kind of routing other than actions which are useless too. YMMV but I would use anything other than fpweb if I was ever going to try again.

I guess I should edit this too. It was very negative, though what i said still stands true.

The piece of software that is using fpweb is very stable with cmem on Linux. It was leaking like crazy without cmem. This piece of software also has an identical golang version, I also wrote. The Pascal version is much much faster than the golang version at least until Pascal hits a celling and go can overtake it with its lightweight multiplexed threads.
« Last Edit: April 06, 2017, 12:38:59 am by john horst »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8744
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: HTTPS best fpc solution?
« Reply #2 on: April 07, 2017, 01:34:13 am »
Use reverse proxy against either FastCGI/embedded HTTP server. Libraries are not enough to have full webserver capabilities, delegate that part to real web server instead.

Blestan

  • Sr. Member
  • ****
  • Posts: 461
Re: HTTPS best fpc solution?
« Reply #3 on: April 07, 2017, 02:50:53 pm »
any ideas how what approach to use under lightppd? i.e single thread multitle processes or multithreading in a single process?
Speak postscript or die!
Translate to pdf and live!

Leledumbo

  • Hero Member
  • *****
  • Posts: 8744
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: HTTPS best fpc solution?
« Reply #4 on: April 10, 2017, 04:47:49 am »
any ideas how what approach to use under lightppd? i.e single thread multitle processes or multithreading in a single process?
Follow your CPU capability, most likely single thread multiple processes.

Blestan

  • Sr. Member
  • ****
  • Posts: 461
Re: HTTPS best fpc solution?
« Reply #5 on: April 10, 2017, 10:28:14 am »
now im develop the following senario
lighthttp round robin -> fastcgi backends on several intranet  servers  with fixed number of  threads (depends on the cores )with the share nothing paradigm ( jwt based auth on each request)
Speak postscript or die!
Translate to pdf and live!

 

TinyPortal © 2005-2018