summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--game.js4
-rw-r--r--server/src/main.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/game.js b/game.js
index 1110027..48b0560 100644
--- a/game.js
+++ b/game.js
@@ -1,6 +1,6 @@
'use strict';
window.addEventListener('load', function () {
- const socket = new WebSocket("ws://localhost:3000");
+ const socket = new WebSocket(`${location.protocol === "file:" || location.hostname === "localhost" ? "ws://localhost:54472" : "wss://jigsaw.pommicket.com"}`);
const searchParams = new URL(location.href).searchParams;
socket.binaryType = "arraybuffer";
let imageUrl = searchParams.get('image');//"https://upload.wikimedia.org/wikipedia/commons/0/09/Croatia_Opatija_Maiden_with_the_Seagull_BW_2014-10-10_10-35-13.jpg";
@@ -22,7 +22,7 @@ window.addEventListener('load', function () {
if (imageUrl.startsWith('http')) {
// make sure we use https
let url = new URL(imageUrl);
- url.protocol = 'https';
+ url.protocol = 'https:';
imageUrl = url.href;
}
const image = new Image();
diff --git a/server/src/main.rs b/server/src/main.rs
index 4e397f1..059ce44 100644
--- a/server/src/main.rs
+++ b/server/src/main.rs
@@ -266,7 +266,7 @@ fn read_to_lines(path: &str) -> std::io::Result<Vec<String>> {
#[tokio::main]
async fn main() {
- let port = 3000;
+ let port = 54472;
let host_addr = SocketAddr::from(([127, 0, 0, 1], port));
let listener = match tokio::net::TcpListener::bind(host_addr).await {
Ok(l) => l,