Web-development – Web interface with FastCGI or with direct HTTP

httpweb-development

Let's assume I want (for fun at start) to play with some new DSL (domain specific language) idea. And I really want its user[s] (probably only me at first) to interact thru a web interface. I'll probably implement it in C++ (probably using LLVM).

Should I use an HTTP server library (like libonion or microhttpd) to talk directly HTTP or should I use FastCGI? I could also use libraries doing both like cppcms or wt

In particular, I am noticing that several recent web frameworks (Opa, Ocsigen, …) do not have any FastCGI interface but only HTTP one….
(but Ur/Web seems to have both)

So my feeling is that FastCGI is really out of fashion….

Any opinions on that? Do you know recently started project using FastCGI ?
(and what about SCGI?)

Best Answer

Few notes:

So my feeling is that FastCGI is really out of fashion....

Telling this is like to tell that TCP/IP is out of fashion in days of HTTP.

FastCGI is the protocol between web application and the web server - however it does not mean that you need to use it directly from your application.

Should I use an HTTP server library (like libonion or microhttpd) to talk directly HTTP or should I use FastCGI? I could also use libraries doing both like cppcms or wt...

See if you want to develop even a simple web site it is very hard to do it using HTTP alone - there are many factors to handle - this is why there are web frameworks that solve the problem for you, more than that many stuff like static files handing and some security considerations are passed to web server and the framework itself.

So I'd recommend you to use Web framework like CppCMS that allows to implement web application using C++ easily - so basically you work on busyness logic, the rest web framework does for you.

And as a bounce you get support of HTTP, FastCGI, SCGI protocols and you can use either your internal web server or any industry standard protocol with powerful web server.

Related Topic