mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-13 14:30:02 -04:00
log errors when creating connections and add npm export for bundled version
This commit is contained in:
parent
2c04f55a5e
commit
b374d02e48
4 changed files with 31 additions and 13 deletions
|
@ -1,14 +1,21 @@
|
|||
/* REPLACE
|
||||
new WebSocketConstructor
|
||||
ws ?= ?new WebSocketConstructor\(url, ?opts\)
|
||||
*/
|
||||
new ((() => {
|
||||
try {
|
||||
if (api.transport === "wisp") {
|
||||
return WispWebSocket;
|
||||
ws = new WispWebSocket(url);
|
||||
}
|
||||
else if (api.transport === "wsproxy") {
|
||||
return WebSocket;
|
||||
ws = new WebSocket(url);
|
||||
}
|
||||
else if (typeof api.transport === "string") {
|
||||
throw "invalid transport type";
|
||||
}
|
||||
else { //custom transports
|
||||
return api.transport;
|
||||
ws = new api.transport(url);
|
||||
}
|
||||
})())
|
||||
}
|
||||
catch (e) {
|
||||
error_msg("Error while creating a TCP connection: " + e);
|
||||
throw e;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ const copyright_notice = `libcurl.js is licensed under the GNU AGPL v3. You can
|
|||
|
||||
Several C libraries are used, and their licenses are listed below:
|
||||
- libcurl: curl License (https://curl.se/docs/copyright.html)
|
||||
- openssl: Apache License 2.0 (https://github.com/openssl/openssl/blob/master/LICENSE.txt)
|
||||
- wolfssl: GNU GPL v2 (https://github.com/wolfSSL/wolfssl/blob/master/COPYING)
|
||||
- cjson: MIT License (https://github.com/DaveGamble/cJSON/blob/master/LICENSE)
|
||||
- zlib: zlib License (https://www.zlib.net/zlib_license.html)
|
||||
- brotli: MIT License (https://github.com/google/brotli/blob/master/LICENSE)
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
{
|
||||
"name": "libcurl.js",
|
||||
"version": "0.6.0-dev",
|
||||
"version": "0.6.0",
|
||||
"description": "An experimental port of libcurl to WebAssembly for use in the browser.",
|
||||
"main": "libcurl.mjs",
|
||||
"exports": {
|
||||
"bundled": "./libcurl_full.mjs"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue