mormot2 THttpServer

mormot2 THttpServer

THttpServer = class(THttpServerGeneric)

/// main HTTP server Thread using the standard Sockets API (e.g. WinSock)
// - bind to a port and listen to incoming requests
// - assign this requests to THttpServerResp threads from a ThreadPool
// - it implements a HTTP/1.1 compatible server, according to RFC 2068 specifications
// - if the client is also HTTP/1.1 compatible, KeepAlive connection is handled:
// multiple requests will use the existing connection and thread;
// this is faster and uses less resources, especialy under Windows
// - a Thread Pool is used internally to speed up HTTP/1.0 connections - a
// typical use, under Linux, is to run this class behind a NGINX frontend,
// configured as https reverse proxy, leaving default "proxy_http_version 1.0"
// and "proxy_request_buffering on" options for best performance, and
// setting KeepAliveTimeOut=0 in the THttpServer.Create constructor
// - under windows, will trigger the firewall UAC popup at first run
// - don't forget to use Free method when you are finished

///主HTTP服务器线程使用标准的套接字API(例如WinSock)

// -绑定到一个端口并监听传入请求

// -将这个请求分配给ThreadPool中的THttpServerResp线程

// -它实现了一个HTTP/1.1兼容的服务器,根据RFC 2068规范

// -如果客户端也是HTTP/1.1兼容的,则处理KeepAlive连接:

//多个请求将使用现有的连接和线程;

//这是更快和使用更少的资源,特别是在Windows下

//线程池用于内部加速HTTP/1.0连接- a

//在Linux下,典型的用法是在NGINX前端后面运行这个类,

//设置为HTTPS反向代理,保留默认的"proxy_http_version 1.0"

//和"proxy_request_buffering on"选项获得最佳性能,和

//在THttpServer中设置KeepAliveTimeOut=0。创建构造函数

// -在窗口下,将触发防火墙UAC弹出在第一次运行

// -当你完成时不要忘记使用Free方法

posted @ 2021-07-15 08:35  delphi中间件  阅读(559)  评论(0编辑  收藏  举报