Simple Common Gateway Interface

From Wikipedia, the free encyclopedia

(Redirected from SCGI)
Jump to: navigation, search

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.

Contents

The client connects to a 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.

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.

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.

Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.