Closed WMoraes13 closed 3 years ago
It likely means that the bottle server isn't available on port 8000. Did you get any errors from the python side?
I'm not having any errors on the python side ... I created an executable using pyinstaller. When I run my app on my computer it works perfectly but when I try to run it, I use another machine and I always get this connection error.
I am also facing the same issue, it happens always whenever it try to use multiple pages. I have to restart the app 2 or 3 times to fix it.
Same happens with me
Could someone share their code that exhibits this problem?
This problem don't happens all the time, only sometimes. When I reload multiple times, the same error shows up.
I recorded this error: https://youtu.be/RrttD375Fwg
When I go for next page in my app, The python program stops even before closing the window and at console following error occur (Chrome):
WebSocket connection to 'ws://localhost:5010/eel?page=news/news.html' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED (anonymous) @ eel.js:115
And after this error if I click for next page the same error occur as described by @OuthBack
I have identified few cases where this error generally occur:
@parthbyt I'm thinking in add a code that when I get this error he run again, but with a diferent port. Example: running with port localhost:8080 --> ERR_CONNECTION_REFUSED --> Try again with localhost:8081
@OuthBack This may work sometimes, but in few cases both the ports may result ERR_CONNECTION_REFUSED.
Like so running with port localhost:8080 --> ERR_CONNECTION_REFUSED --> Try again with localhost:8081 --> ERR_CONNECTION_REFUSED
@OuthBack thanks for the video - can you confirm which version of Eel you're using?
This looks related to Eel's shutdown detection mechanism, whereby when any websocket closes, it waits 1 second, and then checks if there are now any websocket connections. If not, then Eel closes, thinking that the user has closed the browser and wants to exit the program. In your video you're spamming refresh, which I suspect is preventing any new websocket being established for the full second, and therefore Eel is just closing down.
I think we might want to make the shutdown timer configurable so that you could increase it, meaning there are more chances for the connection to be re-established before Eel shuts down. I'd be a little reluctant to disable this altogether as then it's possibly/likely that Eel would just end up staying alive forever, which feels more confusing as - if configured with a specific port - re-launching the app would error out.
Version 0.14.0 Nice explanation!
@OuthBack @WMoraes13 @parthbyt
Just copy eel.js file into local webapp dir and replace _host: window.location.origin, into your custom IP like below
_host: "http://localhost:8000"
This works for me :100:
@OuthBack thanks for the video - can you confirm which version of Eel you're using?
This looks related to Eel's shutdown detection mechanism, whereby when any websocket closes, it waits 1 second, and then checks if there are now any websocket connections. If not, then Eel closes, thinking that the user has closed the browser and wants to exit the program. In your video you're spamming refresh, which I suspect is preventing any new websocket being established for the full second, and therefore Eel is just closing down.
I think we might want to make the shutdown timer configurable so that you could increase it, meaning there are more chances for the connection to be re-established before Eel shuts down. I'd be a little reluctant to disable this altogether as then it's possibly/likely that Eel would just end up staying alive forever, which feels more confusing as - if configured with a specific port - re-launching the app would error out.
@samuelhwilliams Why do we want this shutdown mechanism in the first place? I think I am looking for a way to have an eel server run all the time and enable several clients to connect to it. Is there a way to achieve this now and is it agains this project's philosophy?
what this error means?
error: eel.js:115 WebSocket connection to 'ws://localhost:8000/eel?page=select_ger.html' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED