jabyrd3 / typeto.me2

Successor to typeto.me
8 stars 3 forks source link

black screen #8

Closed dmd closed 7 months ago

dmd commented 7 months ago

I ran the bare binary (listening on 8089, 8090) and put a (non-ssl) reverse proxy in front of it.

Site comes up as just a black screen. I get:

Listening on http://localhost:8090/
[2024-01-25 13:58:05] [GET] /gui/app.module.js 200

But the orange text doesn't appear - just black.

jabyrd3 commented 7 months ago

can i get your proxy config so i can reproduce the issue

dmd commented 7 months ago
<VirtualHost *:80>

    ServerAdmin dmd@3e.org
    ServerName typeto.me
    ProxyPass / http://127.0.0.1:8089/ Keepalive=On
    ProxyPassReverse / http://127.0.0.1:8089/
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

        ErrorLog ${APACHE_LOG_DIR}/typetome.error.log
        CustomLog ${APACHE_LOG_DIR}/typetome.access.log combined

</VirtualHost>
<VirtualHost *:81>

    ServerAdmin dmd@3e.org
    ServerName typeto.me
    ProxyPass / http://127.0.0.1:8090/ Keepalive=On
    ProxyPassReverse / http://127.0.0.1:8090/
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

        ErrorLog ${APACHE_LOG_DIR}/typetome.error.log
        CustomLog ${APACHE_LOG_DIR}/typetome.access.log combined

</VirtualHost>
dmd commented 7 months ago
WebSocket connection to 'wss://typeto.me:8090/' failed: WebSocket is closed before the connection is established.

It's trying to connect to the back end port, rather than the proxy'd port. Ports as shown to the client need to be configurable - see #5

jabyrd3 commented 7 months ago

i'm gonna hold off on adding configurables, it's nice to be able to run the binary and have it Just Work regardless if it's localhost running bare or behind a proxy

with 1008307 i've changed how the frontend figures out how to connect. i'll update the docs with another commit, but the rules are:

dmd commented 7 months ago

Solved with updated s/http/ws/ ProxyPass:

<IfModule mod_ssl.c>
<VirtualHost *:443>

    ServerAdmin dmd@3e.org
    ServerName typeto.me
    ProxyPass / http://127.0.0.1:8089/ Keepalive=On
    ProxyPassReverse / http://127.0.0.1:8089/
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ErrorLog ${APACHE_LOG_DIR}/typetome.error.log
    CustomLog ${APACHE_LOG_DIR}/typetome.access.log combined

    SSLCertificateFile /etc/letsencrypt/live/typeto.me/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/typeto.me/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
<VirtualHost *:444>

    ServerAdmin dmd@3e.org
    ServerName typeto.me
    ProxyPass / ws://127.0.0.1:8090/ Keepalive=On
    ProxyPassReverse / ws://127.0.0.1:8090/

    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ErrorLog ${APACHE_LOG_DIR}/typetome.error.log
    CustomLog ${APACHE_LOG_DIR}/typetome.access.log combined

    SSLCertificateFile /etc/letsencrypt/live/typeto.me/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/typeto.me/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>