-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug where consecutive self ws call leads to bad forwarding (#377)
- Loading branch information
Showing
2 changed files
with
38 additions
and
7 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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2021 - Haga Rakotoharivelo - https://github.com/haga-rak | ||
|
||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Xunit; | ||
|
||
namespace Fluxzy.Tests.Cases | ||
{ | ||
public class SelfCallTests | ||
{ | ||
[Fact] | ||
public async Task MakeMultipleSelfCall() | ||
{ | ||
var setting = FluxzySetting.CreateLocalRandomPort(); | ||
|
||
await using var proxy = new Proxy(setting); | ||
|
||
var endPoints = proxy.Run(); | ||
using var client = HttpClientUtility.CreateHttpClient(endPoints, setting); | ||
|
||
for (int i = 0; i < 4; i++) { | ||
var response = await client.GetAsync($"http://127.0.0.1:{endPoints.First().Port}/welcome"); | ||
response.EnsureSuccessStatusCode(); | ||
var content = await response.Content.ReadAsStringAsync(); | ||
} | ||
} | ||
} | ||
} |