diff --git a/client/build.sh b/client/build.sh index be013ab..1ef82b5 100755 --- a/client/build.sh +++ b/client/build.sh @@ -28,7 +28,7 @@ EXPORTED_FUNCS="${EXPORTED_FUNCS:1}" #compile options RUNTIME_METHODS="addFunction,removeFunction,allocate,ALLOC_NORMAL" COMPILER_OPTIONS="-o $MODULE_FILE -lcurl -lssl -lcrypto -lcjson -lz -lbrotlidec -lbrotlicommon -lnghttp2 -I $INCLUDE_DIR -L $LIB_DIR" -EMSCRIPTEN_OPTIONS="-lwebsocket.js -sASSERTIONS=1 -sLLD_REPORT_UNDEFINED -sALLOW_TABLE_GROWTH -sALLOW_MEMORY_GROWTH -sEXPORTED_FUNCTIONS=$EXPORTED_FUNCS -sEXPORTED_RUNTIME_METHODS=$RUNTIME_METHODS" +EMSCRIPTEN_OPTIONS="-lwebsocket.js -sENVIRONMENT=worker,web -sASSERTIONS=1 -sLLD_REPORT_UNDEFINED -sALLOW_TABLE_GROWTH -sALLOW_MEMORY_GROWTH -sEXPORTED_FUNCTIONS=$EXPORTED_FUNCS -sEXPORTED_RUNTIME_METHODS=$RUNTIME_METHODS" #clean output dir rm -rf $OUT_DIR diff --git a/client/javascript/main.js b/client/javascript/main.js index f42596b..fc8b6f8 100644 --- a/client/javascript/main.js +++ b/client/javascript/main.js @@ -16,12 +16,8 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -if (typeof window === "undefined") { - throw new Error("NodeJS is not supported. This only works inside the browser."); -} - //everything is wrapped in a function to prevent emscripten from polluting the global scope -window.libcurl = (function() { +const libcurl = (function() { //emscripten compiled code is inserted here /* __emscripten_output__ */ diff --git a/client/libcurl/main.c b/client/libcurl/main.c index f085d7a..249cd24 100644 --- a/client/libcurl/main.c +++ b/client/libcurl/main.c @@ -192,6 +192,8 @@ void finish_request(CURLMsg *curl_msg) { void init_curl() { curl_global_init(CURL_GLOBAL_DEFAULT); multi_handle = curl_multi_init(); + curl_multi_setopt(multi_handle, CURLMOPT_MAX_TOTAL_CONNECTIONS, 50L); + curl_multi_setopt(multi_handle, CURLMOPT_MAXCONNECTS, 40L); FILE* file = fopen("/cacert.pem", "wb"); fwrite(_cacert_pem, 1, _cacert_pem_len, file); diff --git a/client/package.json b/client/package.json index 47caa58..d14d66f 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "libcurl.js", - "version": "0.3.3", + "version": "0.3.4", "description": "An experimental port of libcurl to WebAssembly for use in the browser.", "main": "libcurl.mjs", "scripts": { diff --git a/server/wisp_server b/server/wisp_server index 65d3124..3b0d432 160000 --- a/server/wisp_server +++ b/server/wisp_server @@ -1 +1 @@ -Subproject commit 65d312414aa896d8f9e18f48e8fe37b72d75ee5c +Subproject commit 3b0d432e89cff7eaa850ba8605b180189e237f1b