mirror of
https://github.com/lbr77/SideImpactor.git
synced 2026-05-06 11:14:01 -04:00
more refactor
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
// @ts-ignore
|
||||
import { libcurl } from "../public/anisette/libcurl_full.mjs"
|
||||
import { loadLibcurl, libcurl } from "./wasm/libcurl"
|
||||
|
||||
let initialized = false
|
||||
let initPromise: Promise<void> | null = null
|
||||
@@ -13,10 +12,11 @@ export async function initLibcurl(): Promise<void> {
|
||||
}
|
||||
|
||||
initPromise = (async () => {
|
||||
const loadedLibcurl = await loadLibcurl()
|
||||
const wsProto = location.protocol === "https:" ? "wss:" : "ws:"
|
||||
const wsUrl = `${wsProto}//${location.host}/wisp/`
|
||||
libcurl.set_websocket(wsUrl)
|
||||
await libcurl.load_wasm()
|
||||
loadedLibcurl.set_websocket(wsUrl)
|
||||
await loadedLibcurl.load_wasm()
|
||||
initialized = true
|
||||
})()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user