1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Websockets not working

Discussion in 'Apache' started by Hav0ck, Jun 19, 2020.

  1. #3
    I found nifty little webapp based on the TV show Jeopardy. It uses websockets which I can't seem to get running.
    SEMrush
    The code for the game can be found here: https://github.com/tpavlek/Jeopardy

    I'm pretty sure I have all the mods I need enabled, here's a list of installed ones.

    access_compat.load
    alias.conf
    alias.load
    auth_basic.load
    authn_core.load
    authn_file.load
    authz_core.load
    authz_host.load
    authz_user.load
    autoindex.conf
    autoindex.load
    deflate.conf
    deflate.load
    dir.conf
    dir.load
    env.load
    filter.load
    http2.load
    mime.conf
    mime.load
    mpm_prefork.conf
    mpm_prefork.load
    negotiation.conf
    negotiation.load
    php7.2.conf
    php7.2.load
    proxy.conf
    proxy_connect.load
    proxy_http2.load
    proxy_http.load
    proxy.load
    proxy_wstunnel.load
    reqtimeout.conf
    reqtimeout.load
    rewrite.load
    setenvif.conf
    setenvif.load
    status.conf
    status.load

    My apache conf file is this:
    <VirtualHost *:80>
      DocumentRoot /home/user/Jeopardy/client/
      ServerName jeopardy.url.tld
    
      <Directory /home/user/Jeopardy/client/>
         Options +FollowSymlinks
         AllowOverride All
         Require all granted
      </Directory>
        <FilesMatch \.php$>
            SetHandler application/x-httpd-php
        </FilesMatch>
    
      RewriteEngine on
        RewriteCond %{HTTP:Upgrade} =websocket
        RewriteRule /(.*) ws://localhost:9001/$1 [P,L]
    
      ProxyPass /ws ws://localhost:9001/
      ProxyPreserveHost On
      ProxyVia full
    
      <Proxy>
        Order deny,allow
        Allow from all
      </Proxy>
    
      ErrorLog ${APACHE_LOG_DIR}/jeopardy-error.log
      CustomLog ${APACHE_LOG_DIR}/jeopardy-access.log combined
    
    </VirtualHost>
    Code (markup):
    When I connect to the site on port 80 the site loads up, I can select Player 1, 2, or 3 and the game board loads. It's just at this point where WebSockets are needed that it fails.

    I'd love to get this going to offer an activity for my Scout Troop while we are stuck holding virtual meetings only.

    Thanks,
     
    Last edited by a moderator: Jun 19, 2020
    Hav0ck, Jun 19, 2020 IP
    SEMrush