You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/grpc/interprocess-namedpipes.md
+71-1Lines changed: 71 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,8 @@ author: jamesnk
4
4
description: Learn how to use gRPC for inter-process communication with Named pipes.
5
5
monikerRange: '>= aspnetcore-8.0'
6
6
ms.author: wpickett
7
-
ms.date: 01/18/2023
7
+
ai-usage: ai-assisted
8
+
ms.date: 08/01/2025
8
9
uid: grpc/interprocess-namedpipes
9
10
---
10
11
# Inter-process communication with gRPC and Named pipes
@@ -47,6 +48,75 @@ The preceding example:
47
48
* Calls `ListenNamedPipe` to listen to a named pipe with the specified name.
48
49
* Creates a named pipe endpoint that isn't configured to use HTTPS. For information about enabling HTTPS, see [Kestrel HTTPS endpoint configuration](xref:fundamentals/servers/kestrel/endpoints#listenoptionsusehttps).
49
50
51
+
### Configuring PipeSecurity for Named Pipes
52
+
53
+
To control which users or groups can connect, use the [`NamedPipeTransportOptions`](xref:Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes.NamedPipeTransportOptions) class. This allows a custom [`PipeSecurity`](xref:System.IO.Pipes.PipeSecurity) object to be specified.
* Uses `UseNamedPipes` to access and configure <xref:Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes.NamedPipeTransportOptions>.
89
+
* Sets the <xref:System.IO.Pipes.PipeSecurity> property to control which users or groups can connect to the named pipe.
90
+
* Grants read/write access to the `Users` group. Additional security rules can be added as needed for the scenario.
91
+
92
+
### Customize Kestrel named pipe endpoints
93
+
94
+
Kestrel's named pipe support enables advanced customization, allowing you to configure different security settings for each endpoint using the `CreateNamedPipeServerStream` option. This approach is ideal for scenarios where multiple named pipe endpoints require unique access controls. The ability to customize pipes per endpoint is available starting with .NET 9.
95
+
96
+
An example of where this is useful is a Kestrel app that requires two pipe endpoints with different access security. The `CreateNamedPipeServerStream` option can be used to create pipes with custom security settings, depending on the pipe name.
`GrpcChannel` supports making gRPC calls over custom transports. When a channel is created, it can be configured with a <xref:System.Net.Http.SocketsHttpHandler> that has a custom <xref:System.Net.Http.SocketsHttpHandler.ConnectCallback>. The callback allows the client to make connections over custom transports and then send HTTP requests over that transport.
0 commit comments