Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 27
Use endpoint as default connection option (ADR-119)#590
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,8 @@ | ||
| class Defaults: | ||
| protocol_version = "5" | ||
| fallback_hosts = [ | ||
| "a.ably-realtime.com", | ||
| "b.ably-realtime.com", | ||
| "c.ably-realtime.com", | ||
| "d.ably-realtime.com", | ||
| "e.ably-realtime.com", | ||
| ] | ||
| rest_host = "rest.ably.io" | ||
| realtime_host = "realtime.ably.io" # RTN2 | ||
| connectivity_check_url = "https://internet-up.ably-realtime.com/is-the-internet-up.txt" | ||
| environment = 'production' | ||
| endpoint = 'main' | ||
| port = 80 | ||
| tls_port = 443 | ||
| @@ -53,11 +44,34 @@ def get_scheme(options): | ||
| return "http" | ||
| @staticmethod | ||
| def get_environment_fallback_hosts(environment): | ||
| def get_hostname(endpoint): | ||
| if "." in endpoint or "::" in endpoint or "localhost" in endpoint: | ||
| return endpoint | ||
| if endpoint.startswith("nonprod:"): | ||
| return endpoint[len("nonprod:"):] + ".realtime.ably-nonprod.net" | ||
| return endpoint + ".realtime.ably.net" | ||
| @staticmethod | ||
| def get_fallback_hosts(endpoint="main"): | ||
surminus marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| if "." in endpoint or "::" in endpoint or "localhost" in endpoint: | ||
| return [] | ||
| if endpoint.startswith("nonprod:"): | ||
| root = endpoint.replace("nonprod:", "") | ||
| return [ | ||
| root + ".a.fallback.ably-realtime-nonprod.com", | ||
| root + ".b.fallback.ably-realtime-nonprod.com", | ||
| root + ".c.fallback.ably-realtime-nonprod.com", | ||
| root + ".d.fallback.ably-realtime-nonprod.com", | ||
| root + ".e.fallback.ably-realtime-nonprod.com", | ||
| ] | ||
| return [ | ||
| environment + "-a-fallback.ably-realtime.com", | ||
| environment + "-b-fallback.ably-realtime.com", | ||
| environment + "-c-fallback.ably-realtime.com", | ||
| environment + "-d-fallback.ably-realtime.com", | ||
| environment + "-e-fallback.ably-realtime.com", | ||
| endpoint + ".a.fallback.ably-realtime.com", | ||
| endpoint + ".b.fallback.ably-realtime.com", | ||
| endpoint + ".c.fallback.ably-realtime.com", | ||
| endpoint + ".d.fallback.ably-realtime.com", | ||
| endpoint + ".e.fallback.ably-realtime.com", | ||
| ] | ||
surminus marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.