How to setup RewriteRule for web socket, for OnlyOffice?

Greetings! I'm using openlightspeed as a proxy for the OnlyOffice Document Server. My current config:

extprocessor ds {
  type                    proxy
  maxConns                100
  pcKeepAliveTimeout      60
  initTimeout             60
  retryTimeout            0
  respBuffer              0

context / {
  type                    proxy
  handler                 ds
  addDefaultCharset       off

rewrite  {
  enable                  1
  autoLoadHtaccess        1
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule /(.*) http://ds/$1 [P]
RewriteRule ^/?(.*) "wss://${}/$1" [P,L]
This is part of the configuration.

Everything worked well before the update. On the latest version implemented: Library for exchanging data with the server changed from sockjs to

Now it does not work through a proxy, it gives an error:
Browser cannot connect to wss:// /7.3.2-8/doc/2850524999/c/?EIO=4&transport=websocket

The developers recommended writing rules for Apache:
Rewrite Engine on 
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/?(.*) "ws://backendserver-address/$1" [P,L]
ProxyPass / "http://backendserver-address/"
ProxyPassReverse / "http://backendserver-address/"
Can you please tell me how to create rules for Openlightspeed?
Thank you!
P.S. is IP address OnlyOffice Document Server