tools/embed/jumphp-embed.php: one PHP file (7.4+, curl) that signs the requests to the playground's /api/embed/<slug>/ (HMAC-SHA256 over method, path, query, time and body hash), serves the application under the partner's base path (streamed, Range, gzip passed through, immutable files kept on disk), relays the TCP tickets with the visitor's address, and gives the blocks (disk cache, ETag revalidation, last copy when the playground is down); no cookie either way, security headers. Its end-to-end test (tools/embed/tests/test.sh, Docker), the WordPress plugin (shortcode [jumphp_block app block], the base path answered at plugins_loaded, settings page, secret possibly in wp-config.php), nginx / Caddy / plain PHP examples. docs/embed.md (+ .en), docs/domains.md (+ .en), AGENTS.md section 14. Co-Authored-By: Claude Opus 5.5 <[email protected]>
14 lines
502 B
PHP
14 lines
502 B
PHP
<?php
|
|
// Any PHP site: the first lines of its front controller (index.php). /chat/... is answered by the kit, every other address goes on.
|
|
require '/srv/jumphp-embed/jumphp-embed.php';
|
|
$jumphp = JumphpEmbed::fromConfig([
|
|
'app' => 'caramail-chat',
|
|
'site' => getenv('JUMPHP_EMBED_SITE'),
|
|
'secret' => getenv('JUMPHP_EMBED_SECRET'),
|
|
'base' => '/chat',
|
|
'cache' => __DIR__ . '/var/jumphp-embed',
|
|
]);
|
|
if ($jumphp->serve()) {
|
|
exit;
|
|
}
|
|
// ... and in a page: echo $jumphp->block('login');
|