mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 21:36:40 -10:00
devvm ports on a running VM records the ports and starts only its forwarder again, on every backend: the VM runs on, and connections open through the old forwarder close (ports_forwarding). SetPorts takes the VM's Confinement (host key, proxy and decider ports, Free, which leaves out and warns ports a host program has); Env.forwarding builds it for starts and changes alike. State is written first, so other VMs' forwarders reserve the new ports, and put back if the backend fails. A per-VM lock (platform.LockFile, Forwards.Lock) keeps two runs from leaving a forwarder nothing stops; Stop kills a forwarder that outlives SIGTERM by 2 s. A smolvm or Docker VM started outside devvm gets ports_no_ssh. Removed: ports_set, applyPorts, startPorts, ports_pending, ports_next_start. ports.txtar takes free ports (free_port) instead of fixed ones a host program can hold. Co-Authored-By: Claude Opus 5.5 <[email protected]>