vimflowy icon indicating copy to clipboard operation
vimflowy copied to clipboard

Socket connection closed! - Docker image behind apache

Open pubmania opened this issue 5 years ago • 5 comments

Running docker image behind apache server, I get the error:

Socket connection closed!

Error: Socket connection closed!
    at WebSocket.ws.onclose (https://vimflowy.mydomain.com/build/app.js:81:335053)

running the docker on port 3010 and then doing a proxypass and proxypassreverse etc using following:

    ProxyPreserveHost On
    ProxyPass / http://localhost:3010/
    ProxyPassReverse / http://localhost:3010/
    ProxyPass "/websocket/"  "ws://localhost:3010/websocket"
    ProxyPass "/websocket/" "wss://localhost:3010/websocket"

I have tried variations to above configuration by commenting line 4 and / or 5, removing websocket in end of 4 and 5 but no joy. I am certain it is the Apache config that is causing this issue but I dont know how / what do i need to change. I have to use Apache and cannot use Caddy as shown in the example

pubmania avatar Mar 15 '19 00:03 pubmania

could you try setting KeepAliveTimeout to some very high value?

WuTheFWasThat avatar Mar 15 '19 02:03 WuTheFWasThat

I tried after setting it to 3600 but still same error... I think it is the proxypass settings that are messed up and I don't know what these should be - I am just guessing it based on the caddy conf in your guidance you see...

Trying to connect wss://vimflowy.mydomain.com
index.ts:178 WebSocket connection to 'wss://vimflowy.mydomain.com/socket' failed: Error during WebSocket handshake: Unexpected response code: 404
(anonymous) @ index.ts:178
logger.ts:57 Caught error: 'Uncaught Error: Socket connection error: [object Event]' from  https://vimflowy.mydomain.com/build/app.js:81
logger.ts:57 Error:  Uncaught Error: Socket connection error: [object Event] Error: Socket connection error: [object Event]
    at WebSocket.ws.onerror (index.ts:180) Error: Socket connection error: [object Event]
    at WebSocket.ws.onerror (https://vimflowy.mydomain.com/build/app.js:81:334978) {}

pubmania avatar Mar 15 '19 09:03 pubmania

oh, so it's not working at all? it's not just that the connection closes after awhile?

WuTheFWasThat avatar Mar 15 '19 17:03 WuTheFWasThat

Yep not working at all... just the web page showing the error reported in my first message

pubmania avatar Mar 16 '19 00:03 pubmania

Would you please be able to suggest apache config for websocket like you have done for caddy and I can give it a shot before completely giving up :(

pubmania avatar Mar 16 '19 12:03 pubmania