#### Relevant Code:
import * as admin from "firebase-admin";
import {readFilesync }from "fs";
import * as https from "https",
const serviceAccount = JSON.parse(readFilesync("./serviceAccount.json", "utf8"))
const proxyAgent = new https.Agent({
host:"xxx",
port: 8080,
keepAlive: true,
rejectUnauthorized: false,
});
const client= admin.initializeApp({
credential:admin.credential.cert(
{
clientEmail: serviceAccount.client_email,
privatekey: serviceAccount.private_key,
projectId: serviceAccount.project_id,
},// when serviceAccount is a object, it will raise the "app/invalid-credential" error
// "./serviceAccount.json", when serviceAccount is a file path, can work
proxyAgent
),
httpAgent: proxyAgent,
});