Close accepted VNC connections

This commit is contained in:
Minh Vu 2026-06-22 19:53:31 +02:00
parent b898769396
commit 5bee7a1814
2 changed files with 4 additions and 0 deletions

View File

@ -66,6 +66,8 @@ func runVNCVM(cmd *cobra.Command, args []string) (err error) {
}
go func() {
defer conn.Close()
wsConn, err := client.VMs().PortForward(cmd.Context(), name, vncPort, wait)
if err != nil {
fmt.Printf("failed to forward port: %v\n", err)

View File

@ -56,6 +56,8 @@ func runVNCWorker(cmd *cobra.Command, args []string) (err error) {
}
go func() {
defer conn.Close()
wsConn, err := client.Workers().PortForward(cmd.Context(), name, vncPort)
if err != nil {
fmt.Printf("failed to forward port: %v\n", err)