How to use the ServerCredentials function from bindings

Find comprehensive JavaScript bindings.ServerCredentials code examples handpicked from public code repositorys.

62
63
64
65
66
67
68
69
70
71
var server;
var channel;
before(function() {
  server = new grpc.Server();
  var port_num = server.addHttp2Port('0.0.0.0:0',
                                     grpc.ServerCredentials.createInsecure());
  server.start();
  channel = new grpc.Channel('localhost:' + port_num, insecureCreds);
});
after(function() {
fork icon1
star icon0
watch icon0

+ 2 other calls in file

135
136
137
138
139
140
141
142
143
144
145
146
147
exports.Credentials = grpc.Credentials;


/**
 * ServerCredentials factories
 */
exports.ServerCredentials = grpc.ServerCredentials;


exports.getGoogleAuthDelegate = getGoogleAuthDelegate;


exports.makeGenericClientConstructor = client.makeClientConstructor;
fork icon0
star icon1
watch icon0

86
87
88
89
90
91
92
93
94
95
});
describe('start', function() {
  var server;
  before(function() {
    server = new grpc.Server();
    server.addHttp2Port('0.0.0.0:0', grpc.ServerCredentials.createInsecure());
  });
  after(function() {
    server.forceShutdown();
  });
fork icon1
star icon0
watch icon0

+ 7 other calls in file

66
67
68
69
70
71
72
73
74
75
before(function() {
  server = new grpc.Server();
});
it('should bind to an unused port with fake credentials', function() {
  var port;
  var creds = grpc.ServerCredentials.createFake();
  assert.doesNotThrow(function() {
    port = server.addSecureHttp2Port('0.0.0.0:0', creds);
  });
  assert(port > 0);
fork icon0
star icon1
watch icon0

Other functions in bindings

Sorted by popularity

function icon

bindings.createKey is the most popular function in bindings (8616 examples)