SCGI

Jul 8, 2009 at 5:24 AM
Edited Jul 8, 2009 at 5:26 AM

It might be interesting to support SCGI described at:

http://python.ca/scgi/protocol.txt

http://en.wikipedia.org/wiki/Simple_Common_Gateway_Interface

This would enable various technologies to sit behind the web server. Other light weight web servers such as lighttpd and nginx have this.

 

Just an idea,

Chuck

 

Coordinator
Jul 8, 2009 at 7:50 AM

yes. I'll create a implementation when I get back from my vacation.

Coordinator
Aug 10, 2009 at 12:27 PM

I've started with the implementation but I don't fully understand how the response from the SCGI server looks like. Can someone be kind and post a example reply?

Aug 10, 2009 at 5:21 PM

Sure. It's the full HTTP response:

----

Status: 200 OK

Content-Type: text/html

 

<html><body><p>Hello, world.</p></body></html>

----

So the server does not have to do anything fancy; just pass the textual response in whole.

 

Also, here is a dump of the key/value pairs passed by an actual web server's scgi support:

http://bitbucket.org/webnov8/overlap/wiki/sample_key_value_pairs

That's not the actual format, just the key/value pairs printed by a little scgi program I wrote.

-Chuck

Coordinator
Aug 11, 2009 at 5:39 AM

That isn't a valid HTTP response. I guess I have to parse the SCGI response and create a proper HTTP response.

 

Aug 11, 2009 at 7:20 AM

Sorry, should have said:

HTTP/1.0 200 OK

In any case, it was just an example that I whipped up. It's up to the SCGI program to generate a valid HTTP response. Don't be distracted by my malformed example.

 

Coordinator
Aug 11, 2009 at 9:54 AM
Edited Aug 11, 2009 at 9:55 AM

It's just not your example. It's even the example in the original specification.

 

But if you are sure that the SCGI server will generate a proper response, then I'll be ready with the module today.

Aug 11, 2009 at 12:35 PM

No, you're right. The spec shows the Status: header. I just assumed I had it wrong because I cannot see the point of SCGI returning a partial response. But I see CGI does the same thing as well.

I stand corrected.

Can you reuse your current HTTP header parsing code?