Cgi.this

Initializes it from raw HTTP request data. GenericMain uses this when you compile with -version=embedded_httpd.

NOTE: If you are behind a reverse proxy, the values here might not be what you expect.... it will use X-Forwarded-For for remote IP and X-Forwarded-Host for host

  1. this(string[] args, void delegate(const(ubyte)[]) _rawDataOutput)
  2. this(long maxContentLength, string[string] env, const(ubyte)[] delegate() readdata, void delegate(const(ubyte)[]) _rawDataOutput, void delegate() _flush)
  3. this(BufferedInputRange ir, bool* closeConnection)
  4. this(BufferedInputRange inputData, string address, ushort _port, int pathInfoStarts, bool _https, void delegate(const(ubyte)[]) _rawDataOutput, void delegate() _flush, bool* closeConnection)
    class Cgi
    this
    (,
    string address
    ,
    ushort _port
    ,
    int pathInfoStarts = 0
    ,
    bool _https = false
    ,
    void delegate
    (
    const(ubyte)[]
    )
    _rawDataOutput = null
    ,
    void delegate
    ()
    _flush = null
    ,
    bool* closeConnection = null
    )

Parameters

inputData BufferedInputRange

the incoming data, including headers and other raw http data. When the constructor exits, it will leave this range exactly at the start of the next request on the connection (if there is one).

address string

the IP address of the remote user

_port ushort

the port number of the connection

pathInfoStarts int

the offset into the path component of the http header where the SCRIPT_NAME ends and the PATH_INFO begins.

_https bool

if this connection is encrypted (note that the input data must not actually be encrypted)

_rawDataOutput void delegate
(
const(ubyte)[]
)

delegate to accept response data. It should write to the socket or whatever; Cgi does all the needed processing to speak http.

_flush void delegate
()

if _rawDataOutput buffers, this delegate should flush the buffer down the wire

closeConnection bool*

if the request asks to close the connection, *closeConnection == true.

Suggestion Box / Bug Report