Safari fix for TLS connections in puter

This commit is contained in:
ProgrammerIn-wonderland
2025-10-05 02:02:28 -04:00
committed by Neal Shah
parent 5b09dbb1f5
commit 82732b9e96
@@ -11,6 +11,10 @@ export class PTLSSocket extends PSocket {
super(...args);
super.on("open", (async() => {
if (!rustls) {
// Safari exists unfortunately without good ReadableStream support. Until that is fixed we need this.
if (!globalThis.ReadableByteStreamController) {
await import( /* webpackIgnore: true */ "https://unpkg.com/web-streams-polyfill@3.0.2/dist/polyfill.js");
}
rustls = (await import( /* webpackIgnore: true */ "https://puter-net.b-cdn.net/rustls.js"))
await rustls.default("https://puter-net.b-cdn.net/rustls.wasm")
}