title: Node js client for grpc server
body: <p>I have GRPC server running using openssl - static way and I am trying to connect to server using nodejs client</p>
  
  <p>I do not see any error but I do not see its connecting to server either.
  Please share if you have any sample.</p>
  
  <p>Please refer code below:</p>
  
  <pre><code>    var rootCertPath = path.join('.','.', 'server-root.PEM');
      var privateCertPath = path.join('.','.', 'server-private.PEM');
      var domainCertPath = path.join('.','.', 'server-domain.PEM');
  
      var rootCert = fs.readFileSync(rootCertPath);
      var privateCert = fs.readFileSync(privateCertPath);
      var domainCert = fs.readFileSync(domainCertPath);
  
      var buf1 = new Buffer('rootCert');
      var buf2 = new Buffer('privateCert');
      var buf3 = new Buffer('domainCert');
  
      var chat_proto = grpc.load("Chat.proto").com.company.grpc;
      var client = new chat_proto.ChatService('https://servervip:443',grpc.credentials.createSsl(buf1,buf2,buf3));
  </code></pre>
  
  <p>Chat.proto</p>
  
  <pre><code>  syntax = "proto3";
  
          // Service definition.
  
              service ChatService {
                // Sends a chat
                 rpc chat(stream ChatMessage) returns (stream ChatMessageFromServer) {}
              }
          // The request message containing the user's name.
          message ChatMessage {
            string name = 1;
            string message = 2;
          }
  
          // The response message containing the greetings
          message ChatMessageFromServer {
              string name = 1;
              string message = 2;
          }
  </code></pre>
  
  <p>//Code to make a request</p>
  
  <pre><code>var username = process.argv[2];
  var stdin = process.openStdin();
  
  function main() {
      console.log("starting");
      console.log(client); // prints { '$channel': Channel {} }
      var chat=client.chat();
      chat.on('data', function(msg) {
        console.log(msg.name + ': ' + msg.message);
          console.log("after message");
      });
  
      stdin.addListener('data',function(input) {
          chat.write({ name: username, message: input.toString().trim()
          }); 
  
      });
  
  }
  main();
  </code></pre>