[racket] FastCGI support?

From: Stephen De Gabrielle (spdegabrielle at gmail.com)
Date: Wed Nov 19 05:11:42 EST 2014

Found from 2008
I'll forward the files FWIW

---------- Forwarded message ---------
From: Eddie Sullivan <eddieSull at hotmail.com>
Date: Wed, 10 Dec 2008 at 19:45
Subject: Re: [plt-scheme] Faster CGI
To: <plt-scheme at list.cs.brown.edu>

If anybody's interested, I've attached a simple wrapper for the FastCGI C
library I hacked up when I was first learning Scheme. As a warning, it's
probably not the best written code, and it's definitely incomplete, but it
may be a starting point.

I originally wanted to code up the FastCGI protocol from scratch, but the
networking libraries provided with PLT are not low-level enough (I needed
some way to determine what type of port stdin was, to differentiate between
CGI and FCGI).

Anyway, you should be able to run the same code under FastCGI and regular
CGI. The function "fcgi-loop" takes a no-parameter-function as parameter,
and calls it repeatedly (for FCGI) or once (for CGI). In the case of FCGI,
current-input-port, current-output-port, and current-error-port are
parameterized for the FCGI versions of those ports. It also tries to fake
out the environment variables, but that part's a little hacky.

The attached fcgi-cgi.scm shows an example use. It's a (F)CGI script that
multiplies the two request parameters num1 and num2.

Hope it helps.
-Eddie Sullivan

On Wed, 19 Nov 2014 at 08:47 Matt Gushee <matt at gushee.net> wrote:

> Thank you, Jens. I think I've even seen that before ... although I
> gather SCGI has some limitations compared to FastCGI, it might work
> for me. I'll definitely give it a try.
> On Wed, Nov 19, 2014 at 1:41 AM, Jens Axel Søgaard
> <jensaxel at soegaard.net> wrote:
> > Hi,
> >
> > I think you need: http://www.neilvandyke.org/racket-scgi/
> >
> > /Jens Axel
> >
> >
> > 2014-11-19 9:16 GMT+01:00 Matt Gushee <matt at gushee.net>:
> >> Hello--
> >>
> >> Let me preface this by saying "hi" to the community. This is my first
> >> post here ... I've been working with Chicken Scheme on and off for 7
> >> years or so. I tried out PLT Scheme, as it was then called, a couple
> >> of times in the past, but I felt that it was kind of a toy language.
> >> Having dug in a bit deeper this time, I see now that I was wrong.
> >> Anyway, Chicken has a lot of strengths, including a great toolchain
> >> and a great community, but the libraries often seem like a haphazard
> >> collection of APIs that don't always work well together. Racket feels
> >> like much more of a coherent system, and has much better support for
> >> high-level constructs like signatures and contracts and packages ...
> >> plus I find the documentation quite thorough and readable, if
> >> sometimes a bit hard to navigate. And so it looks like I will be using
> >> Racket to develop a couple of my rather ambitious projects.
> >>
> >> But anyway, for tonight I have one simple question: is there a FastCGI
> >> module/package for Racket anywhere? I see that Section 20 of the Net
> >> library docs mention "the FastCGI library." Does that mean something
> >> that exists, or has existed, or might soon exist, in the Racket world?
> >> Or does it refer to the C library (libfcgi)?
> >>
> >> I don't imagine it would be terribly hard to write a libfcgi wrapper
> >> module, but I don't want to reinvent the wheel if there's already
> >> something out there.
> >>
> >> Thanks for any info!
> >>
> >> --
> >> Matt Gushee
> >> ____________________
> >>   Racket Users list:
> >>   http://lists.racket-lang.org/users
> >
> >
> >
> > --
> > --
> > Jens Axel Søgaard
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20141119/b13459f7/attachment-0001.html>

Posted on the users mailing list.