RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Remote Control HTTP

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 ReferenceGE ExtensionsremoteControl

Remote Control HTTP

Provides a simple HTTP server that exposes REST-style endpoints for remote vehicle control. Registers a virtual input device and emits axis/button events over HTTP.

Provides a simple HTTP server that exposes REST-style endpoints for remote vehicle control. Registers a virtual input device and emits axis/button events over HTTP.


Public API

FunctionSignatureDescription
M.onExtensionLoaded()Starts HTTP server on 0.0.0.0:8081, registers HTTP route handlers
M.onExtensionUnloaded()Unregisters the virtual input device
M.onUpdate(dtReal, dtSim, dtRaw)Pumps HTTP server, emits a sine-wave axis event each frame
M.onFirstUpdate()(exported but nil - no-op)

HTTP Endpoints

RouteResponseDescription
/hello/<number>"hello world: <number>"Demo endpoint with URL parameter
/api/getInfo/{v, arch, ip, port}Returns engine version, architecture, listen address
/api/ping["pong"]Health check
/api/btn{}Toggles virtual button 0 on/off

Internals

  • HTTP server: Uses utils/simpleHttpServer module for lightweight request handling
  • Virtual input device: Registered via getVirtualInputManager() as type httpcontrollerv1 / instance bngremotectrlv1 with 1 axis and 2 buttons
  • Axis demo: Continuously emits a sine-wave value (sin(timer) + 1) / 2 on axis 0

How It Works

  1. onExtensionLoaded starts the HTTP listener and defines route handlers
  2. onUpdate calls ws.update() to process incoming HTTP requests
  3. On first update, registers a virtual input device with the engine's VIM
  4. Each frame emits a sine-wave axis value (demo behavior)
  5. The /api/btn endpoint toggles a button state and emits button events
  6. onExtensionUnloaded cleans up the virtual device

Usage Examples

-- Load the remote control extension
extensions.load('remoteControl_remoteControl')

-- From a browser or curl:
-- GET http://localhost:8081/api/ping    → ["pong"]
-- GET http://localhost:8081/api/getInfo/ → {v: "0.32", arch: "x64", ...}
-- GET http://localhost:8081/api/btn      → toggles virtual button

Key Notes

  • Server binds to 0.0.0.0:8081 - accessible from any network interface
  • The sine-wave axis emission is a demo; real usage would map HTTP inputs to vehicle controls
  • Virtual device supports 1 axis (index 0) and 2 buttons (index 0)
  • Uses os.clockhp() for high-precision input timestamps

See Also

  • Game Engine Overview - Guide

Sorted List

Reference for `gameplay_util_sortedList`, a generic container that manages a list of named, ID-bearing objects with sorted ordering, name-based lookup, and serialization support.

HDR Post-Processing

Initializes the HDR post-processing chain (bright pass, downscale, luminance, combine) on first update. Creates engine-level PostEffect objects if they don't already exist.

On this page

Public APIHTTP EndpointsInternalsHow It WorksUsage ExamplesKey NotesSee Also