Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Desktop] Use fallback mirrors for China users #2424

Merged
merged 4 commits into from
Feb 5, 2025
Merged

Conversation

huchenlei
Copy link
Member

@huchenlei huchenlei commented Feb 5, 2025

Users in China have poor access to the mirrors, but sometimes the initial accessibility check can pass so the default mirror is selected.

This PR checks whether the user in China in a very reliable way and directly set the fallback mirrors for them.

┆Issue is synchronized with this Notion page by Unito

@huchenlei huchenlei requested a review from a team as a code owner February 5, 2025 02:19
@huchenlei huchenlei added the Electron ComfyUI Desktop related label Feb 5, 2025
@huchenlei huchenlei marked this pull request as draft February 5, 2025 02:26
@huchenlei
Copy link
Member Author

It seems like the check is not working because of cors policy. Need to find a workaround.

Copy link
Contributor

@webfiltered webfiltered left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be good to (simultaneously) check download speed on a smallish file. Use the electron API to initiate this, and bypass all the CORS / browser limitations.

@robinjhuang
Copy link
Member

Wonder if we should consider using the IP. Eg check the country code in the response of this API:
https://ipapi.co/json

@huchenlei
Copy link
Member Author

Wonder if we should consider using the IP. Eg check the country code in the response of this API: https://ipapi.co/json

I get following response lol:

{
  "error": true,
  "reason": "RateLimited",
  "message": "Visit https://ipapi.co/ratelimited/ for details"
}

@huchenlei huchenlei marked this pull request as ready for review February 5, 2025 04:09
@huchenlei
Copy link
Member Author

I think if we are not checking the response content like status, the opaque response is good enough.

@robinjhuang
Copy link
Member

Surprised we got rate limited so fast. Supposed to have : "30000 free requests per month (1000 in 24 hours).". Using google looks fine too

@huchenlei huchenlei merged commit 6b64b74 into main Feb 5, 2025
10 checks passed
@huchenlei huchenlei deleted the china-detection branch February 5, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Electron ComfyUI Desktop related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants