https://github.com/yassinmi/grpc-js-namedpipes
A Node.js implementation for Named Pipe communication with .NET
https://github.com/yassinmi/grpc-js-namedpipes
c-sharp dotnet grpc ipc nodejs protocol-buffers
Last synced: 3 months ago
JSON representation
A Node.js implementation for Named Pipe communication with .NET
- Host: GitHub
- URL: https://github.com/yassinmi/grpc-js-namedpipes
- Owner: yassinMi
- Created: 2024-04-11T11:57:56.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-21T20:37:02.000Z (about 1 year ago)
- Last Synced: 2025-01-26T13:09:03.747Z (4 months ago)
- Topics: c-sharp, dotnet, grpc, ipc, nodejs, protocol-buffers
- Language: JavaScript
- Homepage:
- Size: 54.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# grpc-js-namedpipes (project in progress)
A Node.js implementation of the protocol used by [GrpcDotNetNamedPipes](https://github.com/cyanfish/grpc-dotnet-namedpipes)Note: This is not an official [gRPC](https://github.com/grpc/grpc-node/tree/master) implementation. Its mainly designed to
work with [GrpcDotNetNamedPipes](https://github.com/cyanfish/grpc-dotnet-namedpipes) for scenarios involving
inter-process communication between .NET and Node.js over Named Pipes.# Features
- [x] NodeJs Server Implementation
- [x] Unary
- [x] Server Streaming
- [ ] Client Streaming
- [ ] Bidirectional Streaming
- [ ] NodeJs Client Implementation
- [ ] Unary
- [ ] Server Streaming
- [ ] Client Streaming
- [ ] Bidirectional Streaming# Usage
### Node.js Server:
```js
/**
* service implementation
*/
function sayHello(call, callback) {
var reply = new greeterMessages.HelloReply();
reply.setMessage('Hello ' + call.request.getName());
callback(null, reply);
}var namedPipeServer = new NamedPipeServer("MY_NAMED_PIPE");
namedPipeServer.addService(greeterServices.GreeterService, { sayHello: sayHello })
namedPipeServer.start((error) => {
if (error === undefined) {
console.log("server listening")
}
})
```### .NET C# Client:
(see [GrpcDotNetNamedPipes](https://github.com/cyanfish/grpc-dotnet-namedpipes))
```c#
var channel = new GrpcDotNetNamedPipes.NamedPipeChannel(".", "MY_NAMED_PIPE");
var client = new Greeter.GreeterClient(channel);var response = await client.SayHelloAsync(new HelloRequest { Name = "World" });
Console.WriteLine(response.Message); //prints "Hello World"
```