Skip to content

Commit

Permalink
example for ssl works
Browse files Browse the repository at this point in the history
  • Loading branch information
iangeckeler committed Aug 13, 2019
1 parent 5dc7487 commit 8a6246b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions examples/firecomm/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ const routeguide = require("./routeguide.js");

const firecomm = require("../../index");

let certificate = path.join(__dirname, "/server.crt");
let certificate = path.join(__dirname, "/test2.crt");

const stub = new firecomm.Stub(routeguide.RouteGuide, "localhost:3000");
const stub = new firecomm.Stub(routeguide.RouteGuide, "localhost:3000", {
certificate
});

// const healthStub = new firecomm.HealthStub("localhost:3000");

Expand Down
12 changes: 6 additions & 6 deletions examples/firecomm/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ server.addService(
// server.handlers["/routeguide.RouteGuide/UnaryChat"]
// );

let certPath = path.join(__dirname, "/server.crt");
let keyPath = path.join(__dirname, "/server.key");
let certPath = path.join(__dirname, "/test2.crt");
let keyPath = path.join(__dirname, "/test2.key");

server.bind("0.0.0.0:3000", {
const result = server.bind("0.0.0.0:3000", {
privateKey: keyPath,
certificate: certPath
});
// console.log({server})
// console.log({ result });
// console.log({ server });
// console.log(server.__proto__);
// console.log(new grpc.Server().__proto__)

server.start();

// console.log(server.server)

0 comments on commit 8a6246b

Please sign in to comment.