Field | Type | Description |
headers? | Record<string, string[]> | Request header. |
timeout? | number | The timeout period in milliseconds. |
export default () => {// Establish a connection.client.connect('grpcb.in:9000', { insecure: true });// Call the method.const rsp = client.invoke('addsvc.Add/Sum',{ a: 1, b: 2 },// Configure InvokeOption.{headers: {example: ['a', 'b'],}timeout: 5000,});console.log(rsp.data.v); // 3// Close the connection.client.close();};