mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-14 06:50:00 -04:00
working reclaim tls shim
This commit is contained in:
parent
bcda300153
commit
0cab209e9d
8 changed files with 1289 additions and 9 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue