-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make websocket handler scoped
- Loading branch information
Farid Kadyrov
committed
Apr 22, 2020
1 parent
df971bb
commit 2382b6c
Showing
7 changed files
with
34 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,27 @@ | ||
using System.Net.Http; | ||
using System; | ||
using System.Net.Http; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Microsoft.Extensions.Configuration; | ||
|
||
namespace App2 | ||
{ | ||
public class App3Client | ||
{ | ||
private readonly HttpClient _client; | ||
private readonly IConfiguration _config; | ||
|
||
public App3Client(HttpClient client) | ||
public App3Client(HttpClient client, IConfiguration config) | ||
{ | ||
_client = client; | ||
_config = config; | ||
} | ||
|
||
public async Task SendAsync(string message) | ||
{ | ||
await _client.PostAsync("/ping", new StringContent(message, Encoding.UTF8, "application/json")); | ||
var uri = new Uri(_config["Dependency"] + "/ping"); | ||
|
||
await _client.PostAsync(uri, new StringContent(message, Encoding.UTF8, "application/json")); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,5 @@ | |
} | ||
}, | ||
"AllowedHosts": "*", | ||
"Dependency": "http://localhost:5002/app3" | ||
"Dependency": "http://localhost:5002" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,5 @@ | |
} | ||
}, | ||
"AllowedHosts": "*", | ||
"Dependency": "http://localhost:5001/app2" | ||
"Dependency": "http://localhost:5001" | ||
} |