0

I'm running gRPC server that implements the service interface and a Envoy proxy that allows the client to connect, the following js code (file health.js) builded using webpack and referenced dist/main.js into HTML file make success call and it's work

const { HealthCheckRequest, HealthCheckReply } = require("./protobuf/service_pb")
const { ProtoClient } = require("./protobuf/service_grpc_web_pb")
var client = new ProtoClient('http://localhost:8080');

var request = new HealthCheckRequest()
client.healthCheck(request, {}, (err, response) => {
    console.log(response)
})

I would like to execute this function in a NodeJS server and not in a browser, in fact executing the command node health.js the following error occurred

...
ReferenceError: XMLHttpRequest is not defined
...
Lorenzo D'Isidoro
  • 2,139
  • 3
  • 16
  • 20

1 Answers1

1

There is no support for this at the moment. You may create a feature request over our repository at https://github.com/grpc/grpc-node

Since it's in effect a different protocol, new code needs to be written in order to support it.

Nicolas Noble
  • 699
  • 3
  • 7