RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

cdefDebugDraw ReferencecdefGpuMesh ReferencecdefImgui ReferencecdefMath Referencecdefs ReferencecontrolSystems Referencecsvlib ReferencedelayLine Referencedequeue ReferencedevUtils ReferenceEvent Referenceextensions Referencefilters Referencegraphpath Referenceguihooks ReferenceinputFilters ReferenceinterpolatedMap Referenceintrospection ReferencejbeamWriter Referencejson-ast Referencejson ReferencejsonDebug ReferencejsonPrettyEncoderCustom Referencekdtreebox2d Referencekdtreebox3d Referencekdtreepoint3d Referencelpack ReferenceluaBinding ReferenceluaCore ReferenceluaProfiler Referencemathlib Referenceparticles Referencequadtree Referencesettings ReferencetcpServer ReferencetimeEvents Referenceutils Reference
calltracer ReferencedateUtils ReferencedebugDraw Referencefilterchain Referenceutils/ - Utility Modulesheatmap ReferencehttpJsonServer ReferenceinteractiveShell ReferencelanguageMap Referenceperf Referencepixellib ReferencesimpleHttpServer ReferencetorqueScriptParser ReferencewsUtils Reference

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API Referencecommonutils

simpleHttpServer Reference

Module defined in `lua/common/utils/simpleHttpServer.lua`. Simple HTTP server with static file serving, JSON responses, custom route handlers, and HTML templating.

Module defined in lua/common/utils/simpleHttpServer.lua. Simple HTTP server with static file serving, JSON responses, custom route handlers, and HTML templating.


Exports

Functions

M.start(_bindhost, _bindport, _fileroot, _handlers, _argsCallback)

Start the HTTP server.

  • Parameters:
    • _bindhost - string - Bind hostname/IP
    • _bindport - number - Bind port
    • _fileroot - string - Root directory for static files
    • _handlers - table - Route handler table mapping paths to functions
    • _argsCallback - function|nil - Callback for query parameter processing

M.stop()

Stop the HTTP server and close all connections.

M.update()

Poll for and process incoming HTTP requests. Call each frame.

  • Returns: table - Request processing results

Internal Notes

  • Uses LuaSocket for TCP networking
  • MIME type detection via file extension mapping
  • serve_file serves static files with appropriate MIME headers
  • serve_json serializes Lua tables as JSON responses
  • handle routes requests to registered handlers or falls back to file serving
  • Uses resty/template (lustache) for HTML templating
  • Non-blocking polling via socket.select with zero timeout

pixellib Reference

Module defined in `lua/common/utils/pixellib.lua`. Small pixel drawing library for rendering primitives and text to RGBA buffers, with file save support.

torqueScriptParser Reference

Module defined in `lua/common/utils/torqueScriptParser.lua`. Parses TorqueScript source code into an AST using PEG (Parsing Expression Grammar).

On this page

ExportsFunctionsM.start(_bindhost, _bindport, _fileroot, _handlers, _argsCallback)M.stop()M.update()Internal Notes