I’m unable to connect to server. Keep showing Error: 14 UNAVAILABLE: read ECONNRESET
Here’s my client code:
import { Metadata, credentials } from "@grpc/grpc-js";
import { inventory } from "./protos/ts/inventory/product/publicapi/v1/product";
console.log("Hello World!");
const client = new inventory.product.publicapi.v1.ProductServiceClient(
"kodiak-platform.fly.dev",
credentials.createInsecure()
);
const req = new inventory.product.publicapi.v1.ListRequest();
const meta = new Metadata();
meta.add("authorization", "Bearer abcd");
client.List(
req,
meta,
(err: Error | null, res?: inventory.product.publicapi.v1.ListResponse) => {
if (err) {
console.log(err);
} else {
console.log(res?.toObject());
}
}
);
Any insights? Thanks in advance