public function errorResponse($connection, $statusCode, $body=null,  $reason=null, array $headers=[])
    {
        $res= new Response($statusCode, $body);
        if(!$reason) {
            $res->statusReason = \yii\web\Response::$httpStatuses[$statusCode];
        }
        
        if($body === null){
            $res->body = \yii\web\Response::$httpStatuses[$statusCode];
            
            $errpage = $this->getErrorPageFile($res->statusCode);
            
            if($errpage) {
                ob_start();
                include $errpage;
                $res->body = ob_get_clean();
            }
        }
        
        foreach($headers as $name => $value){
            $res->headers->add($name, $value);
        }
        
        $res->headers->remove('Content-Length');
        $res->headers->set('Connection', 'Close');
        
        $connection->close($res);
    }