TR

← Runtime

Dokümantasyon — Runtime

JumPHP runtime

Lets an application that runs in the browser connect (TCP, SSH, UDP, ping) from the user's own computer and network: their IP, their VPN, a server that only opens to them. It needs the small JumPHP runtime program on their computer (a tray icon) and their consent. This extension is the engine side: the client ($engine->runtime()), the status badge and the install guide. The protocol is in docs/runtime-protocol.md, the human guide in docs/runtime.md.

Only active in the browser (Platform::isWasm()); on the desktop the application already has its network and the client is always unsupported.

Use it

$runtime = $this->engine->runtime();        // RuntimeClient (the core's NoRuntime without this extension)
$runtime->state();                           // unknown | checking | missing | running | ready | refused | unsupported
$runtime->check()->then(fn (string $state) => ...);
$runtime->pair($id, $title)->then(fn (bool $granted) => ...);      // the runtime's own window asks the user
$runtime->on('change', fn (string $state) => ...);
$runtime->bridgeUrl();                       // ws://127.0.0.1:47820/v1

In a Gui form, the badge (it looks for the runtime by itself, a click asks the authorisation or opens the guide):

- {class: JumPHP\Runtime\RuntimeBadge, id: runtime}

Your connections do not change: $engine->tcp()->connect(...), ssh(), udp(), icmp() choose the bridge by net_mode.

project.yaml

Key Default
net_mode auto auto: the runtime when ready, else the server's bridge; server: always the server; local: the runtime or a clear error. Also JUMPHP_NET_MODE (page / env)
jumphp_runtime {version: 0.1.6, page: https://jumphp.net/runtime, releases: https://git.jumphp.net/jumphp/jumPhp/releases} what the guide links to (release tag runtime-v<version>)

Samples

  • BadgeSample: the badge in each state (a hand-driven fake runtime).
  • GuideSample: the install guide, which turns green by itself.
  • NetModeSample: which bridge auto, server and local open for each state.

For tests, ManualRuntime is a runtime whose state you set: $engine->setRuntime(new ManualRuntime(RuntimeLink::READY)).

Runtime Eğitim