Simple Common Gateway Interface

Simple Common Gateway Interface

The Simple Common Gateway Interface (SCGI) is a protocol for applications to interface with HTTP servers, an alternative to the CGI protocol. It is similar to FastCGI but is designed to be easier to implement.

The specification document was placed in the public domain by Neil Schemenauer on 12 January 2006.

Specification

The client connects to an SCGI server over a reliable stream protocol allowing transmission of 8-bit bytes. The client begins by sending a request. See below for the format of the request. When the SCGI server sees the end of the request it sends back a response and closes the connection. The format of the response is not specified by this protocol.

Request format

A request consists of a number of headers and a body. The format of the headers is:

headers ::= header* header ::= name NUL value NUL name ::= notnull+ value ::= notnull* notnull ::= <01> | <02> | <03> | ... | NUL = <00>

Duplicate names are not allowed in the headers. The first header must have the name "CONTENT_LENGTH" and a value that is the length of the body in decimal. The "CONTENT_LENGTH" header must always be present, even if its value is "0". There must also always be a header with the name "SCGI" and a value of "1". In order to facilitate the transition from CGI, standard CGI environment variables should be provided as SCGI headers.

The headers are sent to the server application encoded as a netstring. The body is sent following the headers and its length is specified by the "CONTENT_LENGTH" header.

Example

The web server (an SCGI client) opens a connection and sends the concatenation of the following strings:

"70:" "CONTENT_LENGTH" <00> "27" <00> "SCGI" <00> "1" <00> "REQUEST_METHOD" <00> "POST" <00> "REQUEST_URI" <00> "/deepthought" <00> "," "What is the answer to life?"

The web application (SCGI server) sends the following response:

"Status: 200 OK" <0d 0a> "Content-Type: text/plain" <0d 0a> "" <0d 0a> "42"

The SCGI server then closes the connection.

Web Servers that implement SCGI

* Apache HTTP server
* Lighttpd
* Cherokee
* [http://www.mathopd.org Mathopd - with unofficial patch]

Language bindings for the SCGI API

* Python
* Lisp
* Perl
* Haskell
* Java

External links

* [http://python.ca/scgi/protocol.txt SCGI specification]
* [http://cr.yp.to/proto/netstrings.txt netstrings specification]
* [http://python.ca/scgi/ Apache SCGI modules and Python SCGI interface]
* [http://www.cherokee-project.com/bugs/browser/cherokee/trunk/cherokee/handler_scgi.c Cherokee SCGI module]
* [http://search.cpan.org/~vipercode/SCGI/lib/SCGI.pm Perl SCGI interface]
* [http://snippets.dzone.com/posts/show/4304 Java SCGI connector]
* [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/scgi Haskell SCGI package]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Simple Common Gateway Interface — o SCGI ( interfaz de entrada común simple ) es un protocolo que fue creado como alternativa al protocolo Common Gateway Interface (CGI). Es un estándar para aplicaciones que utilizan interfaces con servidores HTTP. Es muy similar al protocolo… …   Wikipedia Español

  • Simple Common Gateway Interface — Le protocole Simple Common Gateway Interface (SCGI) est le remplaçant du protocole CGI. Il est similaire à FastCGI, mais il est plus facile à mettre en place. Voir aussi FastCGI Web Server Gateway Interface Variables d environnement CGI NCSA… …   Wikipédia en Français

  • Simple Common Gateway Interface — Das Simple Common Gateway Interface (SCGI) ist ein Standard für den Datenaustausch zwischen einem Webserver und dritter Software, die Anfragen bearbeitet. Es ist eine Alternative zu klassischem CGI und ähnelt dem FastCGI Protokoll. Die… …   Deutsch Wikipedia

  • Common Gateway Interface — This article is about the interface between a web server and an external application. For the term CGI in computer graphics, see Computer generated imagery. The Common Gateway Interface (CGI) is a standard (see RFC 3875: CGI Version 1.1) method… …   Wikipedia

  • Common Gateway Interface — La Common Gateway Interface (littéralement « Interface de passerelle commune »), généralement abrégée CGI, est une interface utilisée par les serveurs HTTP. Elle a été normalisée et décrite en version 1.1 dans la RFC 3875[1]. Sommaire 1 …   Wikipédia en Français

  • Web Server Gateway Interface — La Web Server Gateway Interface est une spécification qui définit une interface entre des serveurs et des applications web pour le langage Python. Voir aussi Common Gateway Interface Simple Common Gateway Interface FastCGI Variables d… …   Wikipédia en Français

  • Web Server Gateway Interface — The Web Server Gateway Interface defines a simple and universal interface between web servers and web applications or frameworks for the Python programming language.IdeaHistorically Python web application frameworks have been a problem for new… …   Wikipedia

  • Gateway — Cette page d’homonymie répertorie les différents sujets et articles partageant un même nom. Sur les autres projets Wikimedia : « Gateway », sur le Wiktionnaire (dictionnaire universel) Gateway est un mot anglais qui, au sens propre …   Wikipédia en Français

  • Simple Object Access Protocol — SOAP im TCP/IP‑Protokollstapel: Anwendung SOAP HTTP HTTPS … Transport TCP Internet IP (IPv4 …   Deutsch Wikipedia

  • Simple object access protocol — SOAP im TCP/IP‑Protokollstapel: Anwendung SOAP HTTP HTTPS … Transport TCP Internet IP (IPv4 …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”