Apache Reverse Proxy to Figma Prototype with Websocket

Viewed 20

I am trying to reverse proxy a Figma prototype to the domain I have with SSL configured. Proxying it to the main Figma page works but I cannot connect it to my prototype page.

For example, how can I connect to the following Figma sample page? https://www.figma.com/proto/KVm2roB2LnduHTLJjKjkfn/Prototyping-in-Figma

Below is the conf file used for reverse proxying to the Figma main home page with https://exampledomain.com. So this works, but if I try to access the prototype page at https://exampledomain.com/proto/KVm2roB2LnduHTLJjKjkfn/Prototyping-in-Figma , it displays only the loading page and does not proceed to the prototype.

<IfModule mod_ssl.c>
    <VirtualHost _default_:443>
        Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains;"
        SSLUseStapling on
        ServerName exampledomain.com
        DocumentRoot /var/www/exampledomain

        ProxyRequests Off
        SSLProxyEngine On
        ProxyPreserveHost Off

        ProxyPass / https://www.figma.com/
        ProxyPassReverse / https://www.figma.com/

        SSLEngine on
        SSLCertificateKeyFile myserver.key
        SSLCertificateFile myserver.crt
        SSLCertificateChainFile myserver.ca-bundle
    </VirtualHost>
</IfModule>

Chrome Console I think the problem here is the Websocket configuration, so I enabled mod_proxy_wstunnel on Apache and added the below configurations, but wasn't successful.

RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule .* "wss://www.figma.com/$1" [P,L]

I'm unsure if it is even possible to configure Websocket to a non-local website as I don't know if I can find Figma's Websocket port number. How can I connect Figma prototype via reverse proxy and change the URL to my domain?

0 Answers
Related