Websocket Error in console on Apache. Websocket isn't working.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jflores
    Member
    • Aug 2019
    • 57

    Websocket Error in console on Apache. Websocket isn't working.

    I'm trying to get websockets working, but keep getting the following error:

    Code:
    WebSocket connection to 'wss://crm.mycrm.com/wss?authToken={some_token}&userId={id}' failed: Error during WebSocket handshake: Unexpected response code: 301
    Then, I see these errors in the console:

    Code:
    WebSocket: Could not unsubscribe from streamUpdate.{entity}.{id}
    My server is apache and my VirtualHost config looks like this:

    Code:
    <VirtualHost *:443>
    
    ...
    
    
    <IfModule proxy_module>
      ProxyRequests Off
      <Location /wss>
        ProxyPass ws://mycrm.com:8080
        ProxyPassReverse ws://mycrm.com.com:8080
      </Location>
    </IfModule>
    
    SSLEngine on
    SSLCertificateFile ...
    
    </VirtualHost>
    I copied the code from the
    Code:
    /etc/systemd/system/espocrm-websocket.service
    documentation directly & modified my path to my crm.

    I am using Cloudflare, which proxies requests to my subdomain, so I'm not sure if that's causing a problem.

    See here: https://support.cloudflare.com/hc/en...ith-WebSockets

    Do Cloudflare Workers support proxying WebSockets?


    Yes, Cloudflare Workers support proxying WebSockets. However, it currently does not support:
    • Acting as an endpoint (client or server) for a WebSocket session
    • Manipulating or modifying individual messages
    Anyone know what might be preventing the websockets from working?
    Last edited by jflores; 06-01-2020, 01:46 AM.
  • Maximus
    Senior Member
    • Nov 2018
    • 2731

    #2
    Hi there,
    Our team has investigated your Websocket configs and noticed that there is nothing wrong with it. We are using the same configs. The only one thing is different between your and our configuration, that we are not using Cloudflare. So we believe that there might be some issues with it.
    Another one thought is, your URL in the EspoCRM -> Administration -> Settings -> Site URL is not correspond to your real URL address. Please check it first before dive deeper to investigate for a Cloudflare solution.
    Last edited by Maximus; 06-04-2020, 11:03 AM.

    Comment

    Working...