AspNetCoreModule
AspNetCoreModule copied to clipboard
WebSocket does not work if the server URL is remapped with URLRewrite rule
trafficstars
Customer has also reported a similar issue with ARR https://github.com/aspnet/SignalR/issues/911
We need to further investigate this
- Create URLRewrite application as the following
<application path="/URLRewrite">
<virtualDirectory path="/" physicalPath="c:\inetpub\wwwroot\URLRewrite" />
</application>
- Put the following web.config to the c:\inetpub\wwwroot\URLRewrite
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Rewrite to article.aspx">
<match url="^rewrite/([_0-9a-z-]+)/([_0-9a-z-]+)" />
<action type="Rewrite" url="/{R:1}/{R:2}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
- On the websocket client program use the below WebSocket URL which will be redirected to
ws://localhost:8080/websocketecho/testwhere actual websocket server app of Aspnetcore is locatedws://localhost:8080/URLRewrite/rewrite/websocketecho/test
EXPECTED:
Websocket client can connect the websocket server.
ACTUAL:
Websocket client can't connect the websocket server.
👀
Will the problem be resolved if I switch to some other reverse proxy than UrlRewrite module?