@@ -9,21 +9,25 @@ client can be a Browser (User-Agent) then you can manage your connections and do
99operations 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.
1516services .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
2326public MyController (IConnectionManager connectionManager )
2427{
2528 _connectionManager = connectionManager ;
2629}
30+
2731[HttpPost (nameof (SendAsync ))]
2832public 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
4246services .AddProxyWebSockets (options => {
4347 options .WebSocketHostAddress = " localhost:7803" ;
@@ -50,17 +54,17 @@ services.AddNativeWebSockets();
5054// Add MVC framework services.
5155services .AddMvc ();
5256```
53- > Startup Configure
54- ```
57+ #### Startup Configure
58+ ``` csharp
5559// Proxy (Domain App) Client WebSocket - DMZ to API side connections
5660app .UseProxyWebSockets ();
5761// User Agent WebSockets for Browsers
5862app .UseNativeWebSockets ();
5963```
6064
61- > Invocator With Dependency Injection on Clients
65+ #### Invocator With Dependency Injection on Clients
6266
63- ```
67+ ``` csharp
6468public class CustomWebSocketCommandInvocator : IClientWebSocketCommandInvocator
6569{
6670 private readonly IConnectionManager _connectionManager ;
0 commit comments