193 class HttpServer::HandlerInfo {
198 AbstractHttpRequestHandler obj;
205 constructor(
string name, AbstractHttpRequestHandler obj,
string url, *
string content, *softlist shdr);
210 class HttpServer::HttpHandlerList {
220 static checkSpecialHeaders(reference sh);
225 setHandler(
string name,
string url, *
string content, AbstractHttpRequestHandler obj, *softlist special_headers);
229 *HandlerInfo findHandler(*
hash url,
hash hdr,
bool final =
False);
240 class HttpServer::DynamicHandlerInfo :
public HttpServer::HandlerInfo {
248 constructor(
string name, AbstractHttpRequestHandler obj,
string url, *
string content, *softlist shdr);
253 class HttpServer::DynamicHandlerHelper {
265 constructor(Counter c);
273 class HttpServer::DynamicHttpHandlerList :
public HttpServer::HttpHandlerList {
282 setHandler(
string name,
string url, *
string content_type, AbstractHttpRequestHandler obj, *softlist special_headers);
286 removeHandler(
string name);
289 *DynamicHandlerInfo findHandler(*
hash url,
hash hdr, reference dhh);
413 *SSLCertificate cert;
422 bool stopped =
False;
437 const PollInterval = 300ms;
446 HttpHandlerList handlers();
451 constructor(
HttpServer server,
int id, Sequence ss, any sock, *SSLCertificate cert, *SSLPrivateKey key, *
hash hi, *code logger, *code errorlogger, *code stopc,
string name);
496 connectionThread(Socket s,
hash info);
514 const LP_LOGPARAMS = 1 << 16;
515 const LP_LEVELMASK = LP_LOGPARAMS - 1;
525 "101":
"Switching Protocols",
534 "203":
"Non-Authoritative Information",
536 "205":
"Reset Content",
537 "206":
"Partial Content",
540 "207":
"Multi-Status",
543 "208":
"Already Reported",
549 "300":
"Multiple Choices",
550 "301":
"Moved Permanently",
553 "304":
"Not Modified",
556 "307":
"Temporary Redirect",
559 "400":
"Bad Request",
560 "401":
"Unauthorized",
561 "402":
"Payment Required",
564 "405":
"Method Not Allowed",
565 "406":
"Not Acceptable",
566 "407":
"Proxy Authentication Required",
567 "408":
"Request Timeout",
570 "411":
"Length Required",
571 "412":
"Precondition Failed",
572 "413":
"Request Entity Too Large",
573 "414":
"Request-URI Too Long",
574 "415":
"Unsupported Media Type",
575 "416":
"Requested Range Not Satisfiable",
576 "417":
"Expectation Failed",
579 "418":
"I'm a teapot",
582 "420":
"Enhance Yextern Calm",
585 "422":
"Unprocessable Entity",
591 "424":
"Failed Dependency",
594 "425":
"Unordered Collection",
597 "426":
"Upgrade Required",
600 "428":
"Precondition Required",
603 "429":
"Too Many Requests",
606 "431":
"Request Header Fields Too Large",
609 "500":
"Internal Server Error",
610 "501":
"Not Implemented",
611 "502":
"Bad Gateway",
612 "503":
"Service Unavailable",
613 "504":
"Gateway Timeout",
614 "505":
"HTTP Version Not Supported",
615 "509":
"Bandwidth Limit Exceeded",
618 "510":
"Not Extended",
621 "511":
"Network Authentication Required",
637 Sequence seqSessions();
638 Sequence seqListeners();
640 string httpserverstring;
642 bool stopped =
False;
645 HttpHandlerList handlers();
666 DynamicHttpHandlerList dhandlers();
679 constructor(*code logfunc, *code errlogfunc,
bool dbg =
False,
string name =
sprintf(
"Qore-HTTP-Server/%s", HttpServer::Version));
720 hash addListener(softstring sock, *
string cert_path, *
string key_path, *
string name);
733 softlist
addListeners(softstring sock, *
string cert_path, *
string key_path, *
string name);
747 list addINETListeners(*
string node, softstring service, *
string cert_path, *
string key_path, *
string name);
817 listenerStopped(HttpListener l);
889 final HttpListener addListenerIntern(
string sock, *SSLCertificate cert, *SSLPrivateKey key, *
hash hi, *code logger, *code errorlogger, *code stopc, *
string name);
896 static final hash getSSLObjects(
string cert_path, *
string key_path);
903 final list addINETListenersIntern(*
string node, softstring service,
hash sd, *
hash lp, *code logger, *code errorlogger, *code stopc, *
string name);
916 final handleRequest(HttpListener listener, Socket s, reference cx,
hash hdr, *data body, reference close,
bool head =
False);