Skip to content

Commit 7cdbfd2

Browse files
committed
Use correct endpoints for sydney and us east. also wrapped conditionals in brackets.
1 parent 61d22db commit 7cdbfd2

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

Scripts/Connection/WSConnector.cs

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,33 +205,59 @@ public static string FixupURL(string URL)
205205
#if UNITY_2018_2_OR_NEWER
206206
// Use standard endpoints since 2018.2 supports TLS 1.2
207207
if (URL.StartsWith("http://stream."))
208+
{
208209
URL = URL.Replace("http://stream.", "ws://stream.");
210+
}
209211
else if (URL.StartsWith("https://stream."))
212+
{
210213
URL = URL.Replace("https://stream.", "wss://stream.");
214+
}
211215

212-
// Old TLS 1.0 endpoint
216+
// TLS 1.0 endpoint
213217
else if (URL.StartsWith("http://stream-tls10."))
218+
{
214219
URL = URL.Replace("http://stream-tls10.", "ws://stream.");
220+
}
215221
else if (URL.StartsWith("https://stream-tls10."))
222+
{
216223
URL = URL.Replace("https://stream-tls10.", "wss://stream.");
224+
}
217225

218226
// Germany
219227
else if (URL.StartsWith("http://gateway-fra."))
228+
{
220229
URL = URL.Replace("http://gateway-fra.", "ws://stream-fra.");
230+
}
221231
else if (URL.StartsWith("https://gateway-fra."))
232+
{
222233
URL = URL.Replace("https://gateway-fra.", "wss://stream-fra.");
234+
}
223235

224236
// US East
225237
else if (URL.StartsWith("http://gateway-wdc."))
226-
URL = URL.Replace("http://gateway-wdc.", "ws://stream.");
238+
{
239+
URL = URL.Replace("http://gateway-wdc.", "ws://gateway-wdc.");
240+
}
227241
else if (URL.StartsWith("https://gateway-wdc."))
228-
URL = URL.Replace("https://gateway-wdc.", "wss://stream.");
242+
{
243+
URL = URL.Replace("https://gateway-wdc.", "wss://gateway-wdc.");
244+
}
245+
229246

230247
// Sydney
231248
else if (URL.StartsWith("http://gateway-syd."))
232-
URL = URL.Replace("http://gateway-syd.", "ws://stream-syd.");
249+
{
250+
URL = URL.Replace("http://gateway-syd.", "ws://gateway-syd.");
251+
}
233252
else if (URL.StartsWith("https://gateway-syd."))
234-
URL = URL.Replace("https://gateway-syd.", "wss://stream-syd.");
253+
{
254+
URL = URL.Replace("https://gateway-syd.", "wss://gateway-syd.");
255+
}
256+
257+
else
258+
{
259+
Log.Warning("WSConnector", "No case for URL for wss://. Leaving URL unchanged.");
260+
}
235261
#else
236262
// Redirect to TLS 1.0 endpoints.
237263
// Note frankfurt endpoint does not support TLS 1.0.

0 commit comments

Comments
 (0)