Skip to content

Commit 16f63ad

Browse files
committed
Add endpoint conversions for different regions
1 parent 1ac4fec commit 16f63ad

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

Scripts/Connection/WSConnector.cs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,30 @@ public static string FixupURL(string URL)
196196
URL = URL.Replace("http://stream.", "ws://stream.");
197197
else if (URL.StartsWith("https://stream."))
198198
URL = URL.Replace("https://stream.", "wss://stream.");
199+
200+
// Old TLS 1.0 endpoint
199201
else if (URL.StartsWith("http://stream-tls10."))
200202
URL = URL.Replace("http://stream-tls10.", "ws://stream.");
201203
else if (URL.StartsWith("https://stream-tls10."))
202204
URL = URL.Replace("https://stream-tls10.", "wss://stream.");
203-
else if (URL.StartsWith("http://stream-fra."))
204-
URL = URL.Replace("http://stream-fra.", "ws://stream-fra.");
205-
else if (URL.StartsWith("https://stream-fra."))
206-
URL = URL.Replace("https://stream-fra.", "wss://stream-fra.");
205+
206+
// Germany
207+
else if (URL.StartsWith("http://gateway-fra."))
208+
URL = URL.Replace("http://gateway-fra.", "ws://stream-fra.");
209+
else if (URL.StartsWith("https://gateway-fra."))
210+
URL = URL.Replace("https://gateway-fra.", "wss://stream-fra.");
211+
212+
// US East
213+
else if (URL.StartsWith("http://gateway-wdc."))
214+
URL = URL.Replace("http://gateway-wdc.", "ws://stream.");
215+
else if (URL.StartsWith("https://gateway-wdc."))
216+
URL = URL.Replace("https://gateway-wdc.", "wss://stream.");
217+
218+
// Sydney
219+
else if (URL.StartsWith("http://gateway-syd."))
220+
URL = URL.Replace("http://gateway-syd.", "ws://stream-syd.");
221+
else if (URL.StartsWith("https://gateway-syd."))
222+
URL = URL.Replace("https://gateway-syd.", "wss://stream-syd.");
207223
#else
208224
// Redirect to TLS 1.0 endpoints.
209225
// Note frankfurt endpoint does not support TLS 1.0.

0 commit comments

Comments
 (0)