test(iis): wrapper test for ws

This commit is contained in:
2025-07-25 12:14:05 -05:00
parent 63c053b38c
commit 75c17d2065
2 changed files with 5 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ app.Use(async (context, next) =>
if (context.WebSockets.IsWebSocketRequest && if (context.WebSockets.IsWebSocketRequest &&
context.Request.Path.StartsWithSegments("/lst/api/logger/logs")) context.Request.Path.StartsWithSegments("/lst/api/logger/logs"))
{ {
Console.WriteLine("WebSocket request received!");
try try
{ {
var backendUri = new UriBuilder("ws", "localhost", 8080) var backendUri = new UriBuilder("ws", "localhost", 8080)

View File

@@ -9,6 +9,10 @@
<!-- Proxy all requests starting with /lst/ to the .NET wrapper (port 4000) --> <!-- Proxy all requests starting with /lst/ to the .NET wrapper (port 4000) -->
<rule name="Proxy to Wrapper" stopProcessing="true"> <rule name="Proxy to Wrapper" stopProcessing="true">
<match url="^lst/(.*)" /> <match url="^lst/(.*)" />
<conditions>
<!-- Skip this rule if it's a WebSocket request -->
<add input="{HTTP_UPGRADE}" pattern="^WebSocket$" negate="true" />
</conditions>
<action type="Rewrite" url="http://localhost:8080/{R:1}" /> <action type="Rewrite" url="http://localhost:8080/{R:1}" />
</rule> </rule>
</rules> </rules>