new proto.geo.GeoService('backend:50051'); var request = { origin: { lat: 0, lng: 0 }, destination: { lat: 15, lng: 15 } } client.distanceBetween(request, function(error, distance) { // error handling response.end("Distance = " + JSON.stringify(distance) + "\n"); }); Frontend Code