OptionalclockThe clock used for deadlines and the pump time budget. Defaults to LuaSocket's socket.gettime, which is
wall-clock (Unix) time and follows system clock adjustments. The server never lets its view of time go
backwards: a backwards adjustment pauses deadlines until the clock catches up, and a forward adjustment
expires them early. Do not pass simulation time (for example DCS's timer.getTime), which stops while
the simulation is paused and would keep network deadlines from expiring.
OptionalidleSeconds a connection may go without receiving a request byte before it gets 408, in addition to
requestTimeout. 0 disables it. Default 0.
OptionalioThe most bytes read or written by a single socket call. Default 8192.
OptionalmaxThe most connections accepted in one pump. Default 4.
OptionalmaxThe most bytes of declared request bodies held across all connections: a body that does not fit gets 503
(see the memory bound above). Default 33554432 (32 MiB).
OptionalmaxThe most connections held open at once. When it is reached the server stops accepting; further clients wait
in the operating system's listen backlog until a slot frees up. An open connection that has sent nothing
costs little, so this is set well above the expected number of clients: a low value lets a few idle or slow
clients occupy every slot until their deadlines expire. Default 64.
OptionalmaxThe most request handlers run in one pump. Default 4.
OptionalmaxThe most bytes read plus written across all connections in one HttpServer.pump. Default 262144.
OptionalmaxThe most bytes read plus written for one connection in one visit, so busy connections share a pump. Default 32768.
OptionalmaxA cooperative time budget for one pump, in seconds of clock. It is checked between operations: a
handler that is already running is never interrupted, and no new handler starts once it is spent, not even
the pump's first (a request refused for time goes first in the next pump). The first accept and the first
connection visit of a pump always happen, so sockets keep being serviced.
Default 0.005. The default clock is the wall clock, whose resolution is coarse on some platforms
(around 15 ms on Windows), so treat this as a soft limit.
OptionalmaxThe largest accepted Content-Length. Larger declarations get 413 before any body is read. Default 1048576 (1 MiB).
OptionalmaxThe most bytes in the request line plus headers, terminator included. Larger heads get 431. Default 8192.
OptionalmaxThe most header lines in a request. More get 431. Default 64.
OptionalmaxThe largest serialized response retained for sending. A larger response is replaced by 500. Default 4194304 (4 MiB).
OptionalmaxThe most connection visits in one pump. Each connection is visited at most once per pump. Default 32.
OptionalrequestSeconds from accepting a connection until its request must be completely received. An absolute deadline:
receiving more bytes does not extend it. On expiry the client gets 408. Default 10.
OptionalresponseSeconds from starting a response until it must be completely handed to the socket. On expiry the connection is
closed without the rest of the response. Default 30.
Optional configuration for
HttpServer. Every field has a default (see DEFAULT_SERVER_OPTIONS).The defaults are conservative initial settings chosen for small JSON APIs embedded in DCS World. They are not measured recommendations; tune them against your own workload.
Memory bound
Declared request bodies share one budget,
maxBufferedBodyBytes: a body is reserved when its head arrives, and one that does not fit gets503before anything is read or dispatched. Serialized responses are bounded per connection bymaxResponseBytesand in time byresponseTimeout; they are deliberately not part of the body budget, so clients that stop reading large responses cannot make the server refuse small requests from everyone else. Each connection also holds at mostmaxRequestHeaderBytes + ioChunkBytesbytes of head. The server's own buffers are therefore bounded bywhich is 32 MiB + 64 * (16 KiB + 4 MiB), about 289 MiB, with the defaults. That worst case needs 64 clients each leaving a 4 MiB response unread; lower
maxResponseBytesormaxConnectionsif your responses are small or your clients few. Objects the request handler builds (for example the response body string before serialization) are outside this bound.