Radon is the extension/plugin system for RadProxy (and future services within the RadByte ecosystem).
Three radon formats are supported:
- Declarative
*.tomlmanifests (inradons/orradonfigs/) — no programming required. - Cross-platform
*.wasmmodules (inradons/) — a single file works across Windows, Linux, and macOS inside thewasmisandbox. - Native Rust implementations of the
ProxyRadontrait.
File radons/skyblock-route.toml (or in radonfigs/):
id = "skyblock-route"
version = "1.0.0"
api_version = 1
target = "proxy"
description = "Route sky.example.com directly to Skyblock"
route_host = "sky.example.com"
route_to = "127.0.0.1:25568"The proxy and RadServer execute each .wasm module within a wasmi sandbox with a fuel limit of WASM_HOOK_FUEL = 100_000 instructions per hook invocation and StoreLimits (16 MiB linear memory, 10_000 table elements, 4 instances, 2 memories, 4 tables).
radon_on_handshake(protocol_version: i32, server_port: i32, next_state: i32) -> i32next_state:1=Status,2=Login,3=Transfer.- Return
1to reject the connection (RadonAction::Deny), or0to allow it.
radon_on_login(online_players: i32) -> i32- Return
1to reject the login (RadonAction::Deny), or0to allow it.
- Return
| Function | Availability | Signature | Description |
|---|---|---|---|
rad_get_host |
RadProxy |
(ptr: i32, max_len: i32) -> i32 |
Copies hostname (Handshake.server_address) into WASM memory, returns bytes written (or -1 on error). |
rad_get_username |
RadProxy, RadServer |
(ptr: i32, max_len: i32) -> i32 |
Copies player username into WASM memory. |
rad_get_ip |
RadProxy |
(ptr: i32, max_len: i32) -> i32 |
Copies client IP address into WASM memory. |
rad_get_config |
RadProxy, RadServer |
(ptr: i32, max_len: i32) -> i32 |
Copies content of radonfigs/<name>.toml into WASM memory. |
rad_set_deny_reason |
RadProxy |
(ptr: i32, len: i32) |
Sets the denial reason text (up to 4096 UTF-8 bytes) shown to the player when returning 1. |
rad_send_chat |
RadServer |
(ptr: i32, len: i32) |
Sends a chat message to the player who triggered the event. |
rad_broadcast_chat |
RadServer |
(ptr: i32, len: i32) |
Sends a chat message to all players on the server. |
rad_teleport_player |
RadServer |
(x: f64, y: f64, z: f64) |
Teleports player to coordinates (x, y, z). |
rad_set_block |
RadServer |
(x: i32, y: i32, z: i32, state_id: i32) |
Sets block state at coordinates (x, y, z). |
[dependencies]
rad-api = { path = "../RadAPI", default-features = false }use rad_api::v1::wasm;
#[unsafe(no_mangle)]
pub extern "C" fn radon_on_login(_online_players: i32) -> i32 {
if wasm::username() == "BadBot" {
wasm::set_deny_reason("Blocked by WASM Radon");
return wasm::ACTION_DENY;
}
wasm::ACTION_CONTINUE
}Building into a single cross-platform file:
rustup target add wasm32-unknown-unknown
cargo build --target wasm32-unknown-unknown --releaseCopy .wasm into radons/, and its configuration (if needed) into radonfigs/<name>.toml.
Shared interfaces are maintained in a dedicated library crate RadAPI (rad-api) with Cargo features for each version:
rad-api = { path = "../RadAPI", default-features = false, features = ["v1"] }— loads onlyv1(ideal for lightweight.wasmradons).rad-api = { path = "../RadAPI", default-features = false, features = ["v2"] }— loads onlyv2(reserved for future API revisions).rad_api::v1(API_VERSION = 1) —ProxyRadon,RadonContext,RadonAction,RadonManifest,RadonTarget, andrad_api::v1::wasm.rad_api::latest— alias to the currently active/enabled API version.