private function connection_init()
    {
        $opts = $this->config;

        // Headers format
        $headers = [];
        foreach ($opts['headers'] as $key => $value)
            $headers[] = "$key: $value";

        $connection = new JsonRPC\Client($opts['url'], $opts['timeout'], $headers);

        $connection->ssl_verify_peer = $opts['ssl_verify_peer'];
        $connection->debug           = $opts['debug'];
        $connection->named_arguments = isset($opts['named_arguments']) && $opts['named_arguments']===true;

        if (isset($opts['username']) && $opts['username']) {
            $connection->authentication($opts['username'], $opts['password']);
        }

        return $connection;
    }