diff --git a/servers/servers.go b/servers/servers.go index ea8c4a5..69a2379 100644 --- a/servers/servers.go +++ b/servers/servers.go @@ -499,7 +499,7 @@ func (con Connection) RunCommand(ctx *gin.Context) { type Commands struct { CommandType string `json:"CommandType"` - Arguments []any `json:"Arguments"` + Arguments [4]any `json:"Arguments"` } func (con Connection) AttachServer(ctx *gin.Context) { @@ -603,10 +603,10 @@ func (con Connection) AttachServer(ctx *gin.Context) { case "resize": log.Printf("Fake resize %dx%d", Command.Arguments[0].(uint), Command.Arguments[1].(uint)) - // err2 := con.dockerClient.ContainerResize(context.TODO(), containers[0].ID, container.ResizeOptions{Height: Command.Arguments[1].(uint), Width: Command.Arguments[0].(uint)}) - // if err2 != nil { - // log.Printf("Failed to resize container to %dx%d: %s", Command.Arguments[0].(uint), Command.Arguments[1].(uint), err) - // } + err2 := con.dockerClient.ContainerResize(context.TODO(), containers[0].ID, container.ResizeOptions{Height: Command.Arguments[1].(uint), Width: Command.Arguments[0].(uint)}) + if err2 != nil { + log.Printf("Failed to resize container to %dx%d: %s", Command.Arguments[0].(uint), Command.Arguments[1].(uint), err) + } // hijacked, err2 = con.dockerClient.ContainerAttach(context.TODO(), containers[0].ID, container.AttachOptions{Stream: true, Stdin: true, Stdout: true, Stderr: true}) // if err2 != nil {