GRPC Client Unable to Connect to server deployed in fly.io

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

are you using TCP load balancing? have you followed the grpc guide?

Yes i did. It works just fine if i use postman

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.