From bc83974b3839d65bb9a88baaaad807b974656f56 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Tue, 4 Jul 2023 14:39:55 +0200 Subject: [PATCH] Fix: [Emscripten] switch to URL for content-service that supports WebSocket (#11106) In the old days, content.openttd.org and bananas-server.openttd.org ended up on the same route. But with a recent migration, they do not. content.openttd.org only serves the custom TCP protocol, and bananas-server.openttd.org only serves the HTTP(S). Websockets use HTTPS, and as such, should be routed via the latter. --- os/emscripten/pre.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/os/emscripten/pre.js b/os/emscripten/pre.js index 2fb641017c..31858b1894 100644 --- a/os/emscripten/pre.js +++ b/os/emscripten/pre.js @@ -2,7 +2,7 @@ Module.arguments.push('-mnull', '-snull', '-vsdl:relative_mode'); Module['websocket'] = { url: function(host, port, proto) { /* openttd.org hosts a WebSocket proxy for the content service. */ if (host == "content.openttd.org" && port == 3978 && proto == "tcp") { - return "wss://content.openttd.org/"; + return "wss://bananas-server.openttd.org/"; } /* Everything else just tries to make a default WebSocket connection. @@ -41,7 +41,7 @@ Module.preRun.push(function() { /* Check if the OpenGFX baseset is already downloaded. */ if (!FS.analyzePath(content_download_dir + '/baseset/opengfx-0.6.0.tar').exists) { window.openttd_downloaded_opengfx = true; - FS.createPreloadedFile(content_download_dir + '/baseset', 'opengfx-0.6.0.tar', 'https://installer.cdn.openttd.org/emscripten/opengfx-0.6.0.tar', true, true); + FS.createPreloadedFile(content_download_dir + '/baseset', 'opengfx-0.6.0.tar', 'https://binaries.openttd.org/installer/emscripten/opengfx-0.6.0.tar', true, true); } else { /* Fake dependency increase, so the counter is stable. */ Module.addRunDependency('opengfx');