working reclaim tls shim

This commit is contained in:
ading2210 2024-10-03 07:59:35 -04:00
parent bcda300153
commit 0cab209e9d
8 changed files with 1289 additions and 9 deletions

View file

@ -2,18 +2,20 @@
ws ?= ?new WebSocketConstructor\(url, ?opts\)
*/
try {
let transport;
if (api.transport === "wisp") {
ws = new WispWebSocket(url);
transport = new WispWebSocket(url);
}
else if (api.transport === "wsproxy") {
ws = new WebSocket(url);
transport = new WebSocket(url);
}
else if (typeof api.transport === "string") {
throw new TypeError("invalid transport type");
}
else { //custom transports
ws = new api.transport(url);
transport = new api.transport(url);
}
ws = new tls_shim.ReclaimTLSSocket(url, transport);
}
catch (e) {
error_msg("Error while creating a TCP connection: " + e);