Public URLs and webhooks
Serve a sandbox's port over HTTPS, privately or to the public, for a web app or a webhook receiver.
kyora serves a port of a sandbox at https://<name>.kyora.run. Requests reach the sandbox through kyora: it needs no public address, open firewall port or tunnel, and a server listening on 127.0.0.1 inside it is enough. This works with any network mode, none included.
Serve a port
kyora vms create hooks --size s --ttl 1h --network registries
kyora vms exec hooks -- sh -c 'setsid -f python3 -m http.server 8080 > /tmp/http.log 2>&1'
kyora vms expose hooks 8080 --name my-hooks-1234 --public
curl -i https://my-hooks-1234.kyora.run/Replace my-hooks-1234 with a name of your own: 4 to 48 lowercase letters, digits and dashes, starting with a letter and ending with a letter or digit, not starting with xn--, and not one of kyora's reserved names. Names are first come, first served across all accounts.
- Without
--publicthe URL is private: only you, signed in to kyora, can open it. - Without
--namekyora picks a readable one, such asbrisk-otter-4f2a. - Exposing the same name again on another port or sandbox moves it there.
kyora vms expose hooks --list
kyora vms unexpose hooks my-hooks-1234By default a sandbox may have 8 names at once, and an account may hold 1000. A released name is kept from other accounts for 30 days.
Receiving webhooks
Point the sender at https://<name>.kyora.run/<path>. Two things to know about what arrives:
- Request bodies arrive chunked, without
Content-Length. Your server must decode chunked bodies, as most HTTP servers and frameworks do. - Do not hand-set
Transfer-Encodingon HTTP/2 requests you send to a kyora URL.
A hibernated sandbox is woken by the request that reaches it. One that has gone to cold storage answers 503 with Retry-After while it comes back, so the sender should retry. Most webhook senders do.
From a script or another sandbox
A scoped token needs the public-urls scope to expose ports:
kyora vms tokens create hooks-token --scope vms:read --scope vms:write --scope public-urls --expires 7dThe token is printed once. Use it as KYORA_TOKEN for the CLI or the SDKs. Exposing a port is POST /v1/sandboxes/<id>/ports with {"port": 8080, "name": "my-hooks-1234", "public": true}.
Your own domain
kyora vms domain add hooks.example.com --to my-hooks-1234This prints the DNS records to add: a CNAME to custom.kyora.run, and a TXT record at _kyora-verify.hooks.example.com that proves the domain is yours. kyora vms domain status hooks.example.com shows when it is live.