リンクや環境のアドレスを引き取る
新しいボックスでは、リンクやコネクタ経由で外に出ていた名前を、sandbox_wire がその場で自分のプロセスや公開したバージョンに切り替えます。ボックスの URL は変わりません。
sandbox_status → health.features に take-over があるボックス(2026-09-25 12:40 UTC 以降に起動したボックスはすべてそう。イメージは box-202609251946。ボックスは起動したときの boxd を凍結と復帰をまたいで使い続けます)では、いまリンクやコネクタを通ってボックスの外に出ている名前を、sandbox_wire でボックス内のサービスに引き取れます:
sandbox_wire { "id": "<id>", "service": "billing.acme.internal", "port": 8080, "targetPort": 8081 }
sandbox_wire { "id": "<id>", "service": "billing.acme.internal", "port": 8080, "version": "refund-a1b2c3d", "env": { "WORKERS_ENABLED": "false" } }
- 1 つ目は
targetPortで待ち受ける自分のプロセス、2 つ目は公開したバージョンです(envとcontainerPortはいつもどおり使えます)。そのname:portがリンクか環境のアドレスなら、どちらもその名前をその場で引き取ります。 - 名前はボックス内のアドレスをそのまま保つので、DNS の答えをキャッシュしたプログラムもそのまま届きます。以後はボックス内の
targetPortに届きます。 - リンクやコネクタを通って開いていた接続は閉じられ、プログラムは接続し直して、今度はボックスのコピーに届きます。
- リンクはリンクでなくなります。
sandbox_status.servicesからfromBoxとfromPortが消え、相手のボックスのlinkedFromにもこのボックスは出なくなります。ボックスの URL は変わりません。 - 引き取りは、名前が外に出ているそのポートで行います。別のポートでは呼び出しは失敗します:
<name> is reached through the connector or a link on port [<port>]; a name cannot be a service in the box on port <n> and go out on another。名前が複数のポートで外に出ているとき(環境にdb.internal:5432とdb.internal:6432があるなど)は、そのうち 1 つだけを引き取ることもできません:<name> is also reached through the connector or a link on port [<port>]; a name cannot be a service in the box on one port and go out on another。1 つの名前が、あるポートではボックス内のサービスで、別のポートでは外に出る、ということはできません。そうした名前はsandbox_startで宣言してください。そこではすべてのポートでボックスを指します。 - リンクの名前で
modeを切り替えると、常に 409 になります:<name> is a link in this box, which has no box or external mode. Wire it again with fromBox or fromPort to change where it goes, or pass port (and targetPort) to run the service in the box instead。
古いボックス(health.features に take-over がない)では:
- リンクの名前に
portを付けると 409<name> is a link in this box, and box <id> runs boxd <version>, which cannot turn a link into a service in the box. Wire it again with fromBox or fromPort to change where it goes, or start a new box that declares the service、versionを付けると<name> is a link in this box, and box <id> runs boxd <version>, which cannot turn a link into a published version. Start a new box that declares the version, or wire the link again with fromBox or fromPortになります; portやversionで加えた名前が環境のアドレスなら、コネクタ経由のままです。そうした名前はsandbox_startで宣言してください。
すべてのツールとトピックはツールリファレンスに並んでいます。