Skip to content

Commit 79cf4a3

Browse files
Gencebay DemirGencebay Demir
authored andcommitted
README updated
1 parent c27fb00 commit 79cf4a3

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,25 @@ client can be a Browser (User-Agent) then you can manage your connections and do
99
operations with same interfaces.
1010

1111
### Usage for API - Service Layer
12-
> Startup ConfigureServices
13-
```
12+
13+
#### Startup ConfigureServices
14+
```csharp
1415
// Add Net Core Stack socket services.
1516
services.AddNativeWebSockets();
1617
```
17-
> Startup Configure
18-
```
18+
19+
#### Startup Configure
20+
```csharp
1921
app.UseNativeWebSockets();
20-
```
21-
> Controller with Dependency Injection
2222
```
23+
24+
#### Controller with Dependency Injection
25+
```csharp
2326
public MyController(IConnectionManager connectionManager)
2427
{
2528
_connectionManager = connectionManager;
2629
}
30+
2731
[HttpPost(nameof(SendAsync))]
2832
public async Task<IActionResult> SendAsync([FromBody]SimpleModel model)
2933
{
@@ -36,8 +40,8 @@ public async Task<IActionResult> SendAsync([FromBody]SimpleModel model)
3640
```
3741

3842
### Usage for Trusted Clients or Browsering (DMZ) Layer
39-
> Startup ConfigureServices
40-
```charp
43+
#### Startup ConfigureServices
44+
```csharp
4145
// Client WebSocket - DMZ to API side connections
4246
services.AddProxyWebSockets(options => {
4347
options.WebSocketHostAddress = "localhost:7803";
@@ -50,17 +54,17 @@ services.AddNativeWebSockets();
5054
// Add MVC framework services.
5155
services.AddMvc();
5256
```
53-
> Startup Configure
54-
```
57+
#### Startup Configure
58+
```csharp
5559
// Proxy (Domain App) Client WebSocket - DMZ to API side connections
5660
app.UseProxyWebSockets();
5761
// User Agent WebSockets for Browsers
5862
app.UseNativeWebSockets();
5963
```
6064

61-
> Invocator With Dependency Injection on Clients
65+
#### Invocator With Dependency Injection on Clients
6266

63-
```
67+
```csharp
6468
public class CustomWebSocketCommandInvocator : IClientWebSocketCommandInvocator
6569
{
6670
private readonly IConnectionManager _connectionManager;

0 commit comments

Comments
 (0)