question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Socket connection closed! - Docker image behind apache

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pubmaniacommented, Mar 16, 2019

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

0reactions
pubmaniacommented, Mar 16, 2019

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 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

web socket connection closed when behind proxy
Browser console shows "Socket closed". In my test environment I have a Squid-Dansguardian proxy server. IMP: this behaviour is not observed if ...
Read more >
Connection refused? Docker networking and how it impacts ...
Learn how to fix connection refused errors when trying to connect to a Docker container.
Read more >
wss socket connection over apache not working ... - GitHub
Now, I set a proxy server https://sub.mydomain.tld to http://my.ip.add.ress:3000 and things get wrong. Reproduction Steps. On the chrome console ...
Read more >
Why is Exposing the Docker Socket a Really Bad Idea?
Adversaries may break out of a container to gain access to the underlying host. This can allow an adversary access to other containerized ......
Read more >
Protect the Docker daemon socket - Docker Documentation
In the daemon mode, it only allows connections from clients authenticated by a certificate signed by that CA. In the client mode, it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found