Skip to content

Commit 0b217bb

Browse files
committed
Modify place ports to connect through proxy instead of directly to server
1 parent 6628d00 commit 0b217bb

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

Site/src/lib/server/idToPort.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export default (id: number) => 10000 + (id % 50000)
1+
export const proxyOffset = 25000
2+
3+
export default (id: number) => 10000 + (id % proxyOffset)

Site/src/routes/(rbxclient)/game/join/+server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { error } from "@sveltejs/kit"
22
import { membershipType } from "$lib/permissionLevels"
33
import config from "$lib/server/config"
4-
import idToPort from "$lib/server/idToPort"
4+
import idToPort, { proxyOffset } from "$lib/server/idToPort"
55
import { SignData } from "$lib/server/sign"
66
import { db, findWhere, Record } from "$lib/server/surreal"
77
import joinQuery from "./join.surql"
@@ -36,7 +36,7 @@ function serverInfo(place: Session["place"]): ServerAddress {
3636
const url = new URL(config.Orbiter.PublicURL)
3737
return {
3838
serverHostname: url.hostname, // no scheme, the address doesn't usually have a path anyway
39-
serverPort: idToPort(place.id),
39+
serverPort: idToPort(place.id) + proxyOffset, // select the proxy port rather than the port of the server itself
4040
}
4141
}
4242

0 commit comments

Comments
 (0)