HttpServerOptions
Binding, connection and request/response limits for a hosted HTTP server.
Example
Section titled “Example”Where to put it: replace Src/Main.luau in a project created with this SDK. This is the complete entry file.
Project setup: add network.server to Capabilities in lui.json. See the capability guide.
local Window = Instance.new("Window", { Title = "LUI example", Size = UDim2.fromOffset(560, 280),})local Status = Instance.new("TextLabel", { Parent = Window, Text = "Ready", Position = UDim2.fromOffset(16, 170), Size = UDim2.new(1, -32, 0, 72),})local Server = app:GetService("HttpServerService"):CreateServer({Address = "loopback", Port = 0})Server:Route("GET", "/status", function(Request) return {StatusCode = 200, Headers = {{Name = "Content-Type", Value = "text/plain"}}, Body = "Ready: " .. Request.Path}end)Server:Start()Status.Text = "Local URL: http://127.0.0.1:" .. Server.Port .. "/status"Window.Destroying:Connect(function() Server:Close() end)Window.Visible = trueExpected result: Starts an HTTP endpoint on a free local-only port. Open the displayed URL on this machine to see Ready: /status.
For source, manifest, pin and assets together, use the complete practical recipe.
Properties
Section titled “Properties”Address
Section titled “Address”Local bind address. Default loopback is accessible only from this machine.
Type: string?. Read/write field.
Family
Section titled “Family”IPv4, IPv6 or DualStack for the binding.
Type: ("IPv4" \| "IPv6" \| "DualStack")?. Read/write field.
Local port; 0 requests a free port when policy allows.
Type: number. Read/write field.
Requests TLS using explicitly installed host server credentials. true alone does not create a certificate or configure HTTPS.
Type: boolean?. Read/write field.
TimeoutMs
Section titled “TimeoutMs”Per-request deadline, including parsing, handler waiting and reply writing.
Type: number?. Read/write field.
MaxConnections
Section titled “MaxConnections”Bound on admitted connections, within runtime limits.
Type: number?. Read/write field.
MaxRequestBytes
Section titled “MaxRequestBytes”Bound on request body bytes.
Type: number?. Read/write field.
MaxResponseBytes
Section titled “MaxResponseBytes”Bound on generated response body bytes.
Type: number?. Read/write field.
Full type declaration — for type checking and deeper reference
The declaration is generated from the SDK. Self is supplied by a colon call; read means the field cannot be assigned. See how to read this reference.
export type HttpServerOptions = { Address: string?, Family: ("IPv4" | "IPv6" | "DualStack")?, Port: number, TLS: boolean?, TimeoutMs: number?, MaxConnections: number?, MaxRequestBytes: number?, MaxResponseBytes: number?,}Availability and deeper reading
Section titled “Availability and deeper reading”See platform limits before relying on host-specific behavior. The framework design specification and reflection/type sources are deeper engineering references, not extra setup required to build an app.