[Sandbox] Background processes + proxy to reach in-sandbox servers (#4444)
* [Sandbox] Add Sandbox.proxy_url to reach in-sandbox servers — POC
Adds `Sandbox.proxy_url(port, path)` + `Sandbox.proxy_headers` so a server
started inside a sandbox (WebSocket or plain HTTP) can be reached from the
outside through the sandbox server's port proxy. Works for both dedicated and
pool/shared sandboxes; everything goes through the single sandbox-server port.
Requires the matching sandbox-server change (Wauplin/sandbox-server port-proxy-poc).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* [Sandbox] Add background processes + proxy_url_for(scheme=)
- run(background=True) returns a SandboxProcess; add Sandbox.processes()
and SandboxProcess.kill() (spawn / list / kill).
- Rename Sandbox.proxy_url -> proxy_url_for and add a `scheme` arg
(defaults to https://, pass wss:// for WebSocket clients).
- CLI: new `hf sandbox spawn` and `hf sandbox process ls/kill`.
- Update tests, docs and generated CLI reference.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* expose pid, status, etc.
* Update src/huggingface_hub/_sandbox.py
Co-authored-by: célina <hanouticelina@gmail.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: célina <hanouticelina@gmail.com>