flancer32 / pwa-aid-mob

AI Demo PWA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pwa-aid-mob

AI Demo PWA

Configure Apache 2 to proxy Web Sockets

$ sudo a2enmod proxy
$ sudo a2enmod proxy_http
$ sudo a2enmod proxy_http2
$ sudo a2enmod proxy_wstunnel
$ sudo apache2ctl -M | grep proxy
 proxy_module (shared)
 proxy_http_module (shared)
 proxy_http2_module (shared)
 proxy_wstunnel_module (shared)
<VirtualHost *:443>
    ...
    # Redirect all requests to HTTP2 server.
    RewriteEngine  on
    RewriteCond %{HTTP:Upgrade} !websocket [NC]
    RewriteCond %{HTTP:Connection} !upgrade [NC]
    RewriteRule    "^/(.*)$"  "http://localhost:8080/$1"  [P]

    RewriteCond %{HTTP:Upgrade} websocket [NC]
    RewriteCond %{HTTP:Connection} upgrade [NC]
    RewriteRule ^/?(.*) "ws://localhost:8080/$1" [P,L]

</VirtualHost>

About

AI Demo PWA

License:Apache License 2.0


Languages

Language:JavaScript 93.8%Language:HTML 4.2%Language:Shell 1.8%Language:CSS 0.2%