FileHttpServerConnection

BaseHttpServerConnection implementation with files, allowing to e.g. read a request from standard input and write the response to standard output.

Constructors

this
this(File input, File output, string protocol)
Undocumented in source.

Members

Functions

formatLocalAddress
string formatLocalAddress(HttpRequest r)
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

remoteAddressStr
HttpRequest remoteAddressStr [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

protocol
string protocol;
Undocumented in source.

Inherited Members

From BaseHttpServerConnection

timer
TimeoutAdapter timer;

Time-out adapter.

conn
IConnection conn;

Connection used for this HTTP connection.

currentRequest
HttpRequest currentRequest;

The current in-flight request.

persistent
bool persistent;

Whether we will keep the connection open after the request is handled.

optimizeResponses
bool optimizeResponses;

Whether we should compress responses according to the request headers.

satisfyRangeRequests
bool satisfyRangeRequests;

Whether we should follow "Range" request headers.

connected
bool connected;

Are we connected now?

log
Logger log;

Optional HTTP log.

handleRequest
void delegate(HttpRequest request) handleRequest;

Callback to handle a fully received request.

protocol
string protocol;
Undocumented in source.
inBuffer
DataVec inBuffer;
Undocumented in source.
expect
sizediff_t expect;
Undocumented in source.
responseSize
size_t responseSize;
Undocumented in source.
requestProcessing
bool requestProcessing;
Undocumented in source.
firstRequest
bool firstRequest;
Undocumented in source.
timeout
Duration timeout;
Undocumented in source.
timeoutActive
bool timeoutActive;
Undocumented in source.
banner
string banner;
Undocumented in source.
debugLog
void debugLog(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
onNewRequest
void onNewRequest(Data data)
Undocumented in source. Be warned that the author may not have intended to support it.
onDisconnect
void onDisconnect(string reason, DisconnectType type)
Undocumented in source. Be warned that the author may not have intended to support it.
onContinuation
void onContinuation(Data data)
Undocumented in source. Be warned that the author may not have intended to support it.
processRequest
void processRequest(DataVec data)
Undocumented in source. Be warned that the author may not have intended to support it.
logRequest
void logRequest(HttpRequest request, HttpResponse response)
Undocumented in source. Be warned that the author may not have intended to support it.
formatLocalAddress
string formatLocalAddress(HttpRequest r)
Undocumented in source.
idle
bool idle [@property getter]

Idle connections are those which can be closed when the server is shutting down.

writeResponse
void writeResponse(HttpResponse response)

Send the given HTTP response, and do nothing else.

sendResponse
void sendResponse(HttpResponse response)

Send the given HTTP response.

upgrade
Upgrade upgrade(HttpResponse response)

Switch protocols. If response is given, send that first. Then, release the connection and return it.

Upgrade
struct Upgrade
Undocumented in source.
sendHeaders
void sendHeaders(Headers headers, HttpStatusCode status, string statusMessage)
void sendHeaders(HttpResponse response)

Send these headers only. Low-level alternative to sendResponse.

sendData
void sendData(Data[] data)

Send this data only. Headers should have already been sent. Low-level alternative to sendResponse.

acceptMore
bool acceptMore()

Accept more requests on the same connection?

closeResponse
void closeResponse()

Finalize writing the response. Headers and data should have already been sent. Low-level alternative to sendResponse.

remoteAddressStr
HttpRequest remoteAddressStr [@property setter]

Retrieve the remote address of the peer, as a string.

Meta