You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use endpoint as default connection option (ADR-119)
This implements ADR-119[1], which specifies the client connection
options to update requests to the endpoints implemented as part of
ADR-042[2].
The endpoint may be one of the following:
* a routing policy name (such as `main`)
* a nonprod routing policy name (such as `nonprod:sandbox`)
* a FQDN such as `foo.example.com`
The endpoint option is not valid with any of environment, restHost or
realtimeHost, but we still intend to support the legacy options.
If the client has been configured to use any of these legacy options,
then they should continue to work in the same way, using the same
primary and fallback hostnames.
If the client has not been explicitly configured, then the hostnames
will change to the new `ably.net` domain when the package is upgraded.
[1] https://ably.atlassian.net/wiki/spaces/ENG/pages/3428810778/ADR-119+ClientOptions+for+new+DNS+structure
[2] https://ably.atlassian.net/wiki/spaces/ENG/pages/1791754276/ADR-042+DNS+Restructure
// authOptions Embedded an [ably.authOptions] object (TO3j).
245
261
authOptions
246
262
247
-
// RESTHost enables a non-default Ably host to be specified. For development environments only.
248
-
// The default value is rest.ably.io (RSC12, TO3k2).
263
+
// Endpoint specifies the domain used to connect to Ably. It has the following properties:
264
+
// If the endpoint option is a production routing policy name of the form [name] then the primary domain is [name].realtime.ably.net (REC1b4).
265
+
// If the endpoint option is a non-production routing policy name of the form nonprod:[name] then the primary domain is [name].realtime.ably-nonprod.net (REC1b3).
266
+
// If the endpoint option is a domain name, determined by it containing at least one period (.) then the primary domain is the value of the endpoint option (REC1b2).
267
+
// If any one of the deprecated options environment, restHost, realtimeHost are also specified then the options as a set are invalid (REC1b1).
268
+
Endpointstring
269
+
270
+
// Deprecated: this property is deprecated and will be removed in a future version.
271
+
// RESTHost enables a non-default Ably host to be specified. For
272
+
// development environments only. The default value is rest.ably.io (RSC12,
273
+
// TO3k2).
249
274
RESTHoststring
250
275
251
276
// Deprecated: this property is deprecated and will be removed in a future version.
@@ -257,10 +282,12 @@ type clientOptions struct {
257
282
// please specify them here (RSC15b, RSC15a, TO3k6).
258
283
FallbackHosts []string
259
284
285
+
// Deprecated: this property is deprecated and will be removed in a future version.
260
286
// RealtimeHost enables a non-default Ably host to be specified for realtime connections.
261
287
// For development environments only. The default value is realtime.ably.io (RTC1d, TO3k3).
262
288
RealtimeHoststring
263
289
290
+
// Deprecated: this property is deprecated and will be removed in a future version.
264
291
// Environment enables a custom environment to be used with the Ably service.
265
292
// Optional: prefixes both hostname with the environment string (RSC15b, TO3k1).
// WithEndpoint is used for setting Endpoint using [ably.ClientOption].
1154
+
// Endpoint specifies the domain used to connect to Ably. It has the following properties:
1155
+
// If the endpoint option is a production routing policy name of the form [name] then the primary domain is [name].realtime.ably.net (REC1b4).
1156
+
// If the endpoint option is a non-production routing policy name of the form nonprod:[name] then the primary domain is [name].realtime.ably-nonprod.net (REC1b3).
1157
+
// If the endpoint option is a domain name, determined by it containing at least one period (.) then the primary domain is the value of the endpoint option (REC1b2).
1158
+
// If any one of the deprecated options environment, restHost, realtimeHost are also specified then the options as a set are invalid (REC1b1).
1159
+
funcWithEndpoint(envstring) ClientOption {
1160
+
returnfunc(os*clientOptions) {
1161
+
os.Endpoint=env
1162
+
}
1163
+
}
1164
+
1073
1165
// WithEnvironment is used for setting Environment using [ably.ClientOption].
1074
1166
// Environment enables a custom environment to be used with the Ably service.
1075
1167
// Optional: prefixes both hostname with the environment string (RSC15b, TO3k1).
0 commit comments