I’m creating a website for farm management. I’m running a Asp Net Web API on CyberPanel. I’ve done it following this article: Publish & Run ASP.Net on CyberPanel / Linux – Blog of Viov
The problem is i’m using a technology called SignalR. The SignalR is basically a top level abstract layer to simplify web socket (it also include other functionalities but it don’t matter now). Everything was going as expected on the development environment but when I deploy the application and host the Asp Net on Cyberpanel the Web socket stops working.
The Cyberpanel error log prints this:
[2023-05-24 09:26:32.085918 [INFO] [18351] [187.74.137.142:46278#api.milksolve.com.br] Cannot find web socket backend. URI: [/fazendahub]
The client says that the Websocket didn’t send the handshake, so the Websocket definitely is not working. I checked the access log and there I confirmed that the Signalr protocol is broking on the web socket connection. Anyone has a solution?
Edit:
After some research I've figured out that this problem is related to the Virtual Host Reverse Proxy. CyberPanel uses the OpenLiteSpeed, and the only solutions that I've found on internet were to Ngix and Apache.
My Rewrite File:
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
RewriteRule /(.*) ws://127.0.0.1:5000/$1 [P]
Still not working with WebSocket