mirror of
https://github.com/MercuryWorkshop/epoxy-tls.git
synced 2025-05-12 14:00:01 -04:00
add autoreconnect, wisp_mux 1.2.0
This commit is contained in:
parent
5b4fb1392a
commit
a8709255b2
20 changed files with 404 additions and 333 deletions
|
@ -10,7 +10,8 @@ onmessage = async (msg) => {
|
|||
should_perf_test,
|
||||
should_ws_test,
|
||||
should_tls_test,
|
||||
should_udp_test
|
||||
should_udp_test,
|
||||
should_reconnect_test,
|
||||
] = msg.data;
|
||||
console.log(
|
||||
"%cWASM is significantly slower with DevTools open!",
|
||||
|
@ -197,6 +198,14 @@ onmessage = async (msg) => {
|
|||
);
|
||||
await (new Promise((res, _) => setTimeout(res, 5000)));
|
||||
await ws.close();
|
||||
} else if (should_reconnect_test) {
|
||||
while (true) {
|
||||
try {
|
||||
await epoxy_client.fetch("https://httpbin.org/get");
|
||||
} catch(e) {console.error(e)}
|
||||
log("sent req");
|
||||
await (new Promise((res, _) => setTimeout(res, 500)));
|
||||
}
|
||||
} else {
|
||||
let resp = await epoxy_client.fetch("https://httpbin.org/get");
|
||||
console.log(resp, Object.fromEntries(resp.headers));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue