Score:0

Is there a way of rewriting wss to https Apache 2

np flag

Hi im currently trying to find a way to switch out the protocol of a url. Im having a server wich is running fine on its own but behind a apache reverse proxy its throwing the error connection to websocket failed. The problem is that the Websocket is only locally available as wss:// through the ip of the server it gets switched to https://. Is there any way to switch it back ok a apache reverse proxy?

Score:2
ar flag

You don't want to switch protocols. WSS and https are two different protocols - for a reason. If your app requires wss it requires wss.

What you want is to configure Apache to proxy https and wss for you. That can be done with mod_rewrite. Add something along the lines of the following to your vhost stanza:

ProxyRequests Off    
RewriteEngine On
RewriteCond %{HTTP:Connection} Upgrade [NC]
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule /(.*) wss://localhost:8123/$1  [P,L]
T0b1a5 avatar
np flag
no i want to rewrite it because of unraid wich is using wss in the frontend but the protocol is https in the backend
vidarlo avatar
ar flag
That sounds like a bug in Unraid, so you should probably ask them to fix that bug.
T0b1a5 avatar
np flag
There musst be another way
vidarlo avatar
ar flag
If frontend and backend of a product doesn't agree on what protool to use, it's a bug.
T0b1a5 avatar
np flag
Could be but i’m not search for the cause im searching for a solution to fix the problem without changing the code of the server
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.