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

httpJsonServer Reference

Module defined in `lua/common/utils/httpJsonServer.lua`. Simple HTTP server for implementing quick REST APIs within BeamNG. Handles JSON request/response.

Module defined in lua/common/utils/httpJsonServer.lua. Simple HTTP server for implementing quick REST APIs within BeamNG. Handles JSON request/response.


Exports

Functions

M.init(_bindhost, _bindport, _callback)

Initialize and start the HTTP server.

  • Parameters:
    • _bindhost - string - Bind hostname/IP
    • _bindport - number - Bind port
    • _callback - function - Request handler callback

M.update()

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

Internal Notes

  • Uses LuaSocket for TCP
  • receiveRequest parses raw HTTP request lines
  • handleServerRequest routes requests to the callback
  • Parses URLs via socket.url
  • Uses ltn12 for transfer encoding
  • Non-blocking: update() checks for connections with zero timeout

heatmap Reference

Module defined in `lua/common/utils/heatmap.lua`. Generates SVG heatmap visualizations of vehicle paths on the game map, including road overlay.

interactiveShell Reference

Module defined in `lua/common/utils/interactiveShell.lua`. Interactive Lua REPL shell for runtime debugging within BeamNG.

On this page

ExportsFunctionsM.init(_bindhost, _bindport, _callback)M.update()Internal Notes