Skip to content
This repository was archived by the owner on Jun 22, 2025. It is now read-only.
This repository was archived by the owner on Jun 22, 2025. It is now read-only.

ERR_CONNECTION_REFUSED #355

Closed
Closed

Description

@WMoraes13

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

Activity

  1. samuelhwilliams commented on Jul 11, 2020

    @samuelhwilliams
    Collaborator

    It likely means that the bottle server isn't available on port 8000. Did you get any errors from the python side?

  2. WMoraes13 commented on Jul 20, 2020

    @WMoraes13
    Author

    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.

  3. parthbyt commented on Aug 22, 2020

    @parthbyt

    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.

  4. OuthBack commented on Aug 26, 2020

    @OuthBack

    Same happens with me

  5. samuelhwilliams commented on Aug 26, 2020

    @samuelhwilliams
    Collaborator

    Could someone share their code that exhibits this problem?

  6. OuthBack commented on Aug 27, 2020

    @OuthBack

    This problem don't happens all the time, only sometimes. When I reload multiple times, the same error shows up.
    image

  7. OuthBack commented on Aug 27, 2020

    @OuthBack

    I recorded this error:
    https://youtu.be/RrttD375Fwg

  8. parthbyt commented on Aug 28, 2020

    @parthbyt

    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:

    1. When there is heavy load on CPU
    2. When I close the program directly from console. Next time this error occur.
    3. The number of pages I increase, more commonly I see this error.
  9. OuthBack commented on Aug 28, 2020

    @OuthBack

    @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

  10. parthbyt commented on Aug 31, 2020

    @parthbyt

    @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

  11. samuelhwilliams commented on Sep 2, 2020

    @samuelhwilliams
    Collaborator

    @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.

  12. OuthBack commented on Sep 3, 2020

    @OuthBack

    image
    Version 0.14.0
    Nice explanation!

  13. arunsybex commented on Nov 27, 2020

    @arunsybex

    @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 💯

  14. alexisthual commented on Dec 2, 2020

    @alexisthual

    @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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions