Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ What's new in ps5upload, written for humans.

## Unreleased

**Play Together over the internet**
- **Friends joining from Firefox, a VPN or IPv6 are no longer turned away.** Their browser sends more connection details than the hub allowed per minute, so the hub closed the join and the page said it couldn't reach the hub. The hub now allows a realistic amount for every browser and for several devices behind one home connection, and the join page sends only the details the app can use.
- The hub answers its address with a trailing slash too, tells search crawlers to stay away, and counts which limit stopped a connection, so problems like this show up straight away.

## 12.6.35

**Files on a phone**
- **Name and path fields get the full width (#936).** New folder, New file, Rename, Download from a link and Go to path no longer squeeze the text box: on a phone the field takes the width of the card and its buttons sit on their own line, so you can see what you type and the buttons never break mid-word. Tablets and computers look as before.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.6.34
12.6.35
4 changes: 2 additions & 2 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ps5upload-client",
"private": true,
"type": "module",
"version": "12.6.34",
"version": "12.6.35",
"description": "The all-in-one PS5 companion app.",
"homepage": "https://github.com/phantomptr/ps5upload",
"author": "PhantomPtr <phantomptr@gmail.com>",
Expand Down
30 changes: 15 additions & 15 deletions client/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ps5upload-desktop"
version = "12.6.34"
version = "12.6.35"
description = "The all-in-one PS5 companion app."
license = "GPL-3.0-or-later"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion client/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "PS5Upload",
"version": "12.6.34",
"version": "12.6.35",
"identifier": "com.phantomptr.ps5upload",
"build": {
"beforeDevCommand": "npm run dev:vite",
Expand Down
25 changes: 25 additions & 0 deletions client/src/join/rtcTransport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
sdpFingerprint,
STUN_SERVERS,
trackCodecs,
usefulCandidate,
type InternetInvite,
} from "./rtcTransport";

Expand Down Expand Up @@ -75,6 +76,27 @@ describe("internet invite link", () => {
});
});

describe("the candidates the page sends", () => {
it("are the UDP ones with an address: the engine drops .local ones and has no TCP", () => {
for (const ok of [
"candidate:1 1 udp 2122260223 192.0.2.1 5000 typ host generation 0",
"candidate:2 1 UDP 1686052607 203.0.113.9 6000 typ srflx raddr 0.0.0.0 rport 0",
"a=candidate:3 1 udp 1 2001:db8::1 7000 typ srflx",
// A shape this does not know goes as before.
"candidate:x",
]) {
expect(usefulCandidate(ok), ok).toBe(true);
}
for (const no of [
"candidate:4 1 udp 2122260223 0f3c1a2b-1111-4222-8333-944445555666.local 5001 typ host",
"candidate:5 1 TCP 2105524479 192.0.2.1 9 typ host tcptype active",
"candidate:6 1 tcp 1 203.0.113.9 443 typ srflx tcptype passive",
]) {
expect(usefulCandidate(no), no).toBe(false);
}
});
});

describe("the answer's fingerprint", () => {
const sdp = (lines: string[]) => ["v=0", "o=- 1 2 IN IP4 0.0.0.0", "s=-", ...lines, "m=application 9 UDP/DTLS/SCTP webrtc-datachannel", ""].join("\r\n");

Expand Down Expand Up @@ -374,6 +396,9 @@ describe("the WebRTC transport", () => {
expect(dc.binaryType).toBe("arraybuffer");
expect(hub.signals("offer")).toEqual([{ t: "signal", to: "host", data: { type: "offer", sdp: "v=0\r\nOFFER\r\n" } }]);
pc.onicecandidate?.({ candidate: { candidate: "candidate:1 1 udp 1 192.0.2.1 5000 typ host", sdpMid: "0" } });
// What the engine can't use is not sent: each candidate is a signal the hub counts.
pc.onicecandidate?.({ candidate: { candidate: "candidate:7 1 udp 1 0f3c1a2b-1111-4222-8333-944445555666.local 5001 typ host generation 0", sdpMid: "0" } });
pc.onicecandidate?.({ candidate: { candidate: "candidate:8 1 TCP 1 192.0.2.1 9 typ host tcptype active", sdpMid: "0" } });
pc.onicecandidate?.({ candidate: null });
expect(hub.signals("candidate")).toEqual([
{ t: "signal", to: "host", data: { type: "candidate", candidate: "candidate:1 1 udp 1 192.0.2.1 5000 typ host", sdpMid: "0" } },
Expand Down
14 changes: 14 additions & 0 deletions client/src/join/rtcTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,19 @@ export { NET_CLOSE, netFailure, type NetWhy };
export const STUN_SERVERS = ["stun:stun.cloudflare.com:3478", "stun:stun.l.google.com:19302"];
/** ICE must reach "connected" (and the channel open) this soon, or the networks can't meet. */
export const ICE_TIMEOUT_MS = 15_000;

/** A candidate the engine can use: UDP, with an address. It drops `.local` (mDNS) ones and has
* no TCP (join_net/rtc.rs, `Cmd::Remote`). Each candidate sent is a signal the hub counts, and
* it closes a guest past its per-minute limit: the browser gathers a set for each of the page's
* sections (data, video, audio), and Firefox found 20 on one plain network, half of them
* `.local` or TCP. A line of a shape this does not know is sent as before. */
export function usefulCandidate(line: string): boolean {
// candidate:<foundation> <component> <transport> <priority> <address> <port> typ <type> ...
const f = line.trim().replace(/^a=/, "").split(/\s+/);
if (f.length < 8 || f[6] !== "typ") return true;
return f[2].toLowerCase() === "udp" && !f[4].toLowerCase().endsWith(".local");
}

/** The hub closed with 1001 (going away: it is restarting for an update) before the host
* answered: try again after this long, for at most HUB_BACK_FOR_MS. The hosts reconnect and open
* their rooms again within seconds, so a `no_room` in that time means "not back yet". */
Expand Down Expand Up @@ -462,6 +475,7 @@ export function rtcTransport(inv: InternetInvite, o: RtcTransportOptions = {}):
const c = e.candidate;
// The end of gathering (null or empty) needs nothing: the engine takes what came.
if (!c || !c.candidate) return;
if (!usefulCandidate(c.candidate)) return;
const data = { type: "candidate", candidate: c.candidate, sdpMid: c.sdpMid ?? "0" };
// Found while the hub was still connecting: right behind the offer (never ahead of it).
if (this.offerSent) this.signal(data);
Expand Down
Loading
Loading