mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-12 14:00:01 -04:00
add basic websocket support
This commit is contained in:
parent
8ad11cd515
commit
17d8c9fa8c
10 changed files with 292 additions and 29 deletions
|
@ -96,7 +96,7 @@ function perform_request(url, params, js_data_callback, js_end_callback, body=nu
|
|||
|
||||
end_callback_ptr = Module.addFunction(end_callback, "vii");
|
||||
data_callback_ptr = Module.addFunction(data_callback, "vii");
|
||||
_start_request(url_ptr, params_ptr, data_callback_ptr, end_callback_ptr, body_ptr, body_length);
|
||||
let http_handle = _start_request(url_ptr, params_ptr, data_callback_ptr, end_callback_ptr, body_ptr, body_length);
|
||||
_free(params_ptr);
|
||||
|
||||
active_requests ++;
|
||||
|
@ -112,6 +112,8 @@ function perform_request(url, params, js_data_callback, js_end_callback, body=nu
|
|||
}
|
||||
}, 0);
|
||||
}
|
||||
|
||||
return http_handle;
|
||||
}
|
||||
|
||||
function merge_arrays(arrays) {
|
||||
|
@ -271,7 +273,8 @@ return {
|
|||
fetch: libcurl_fetch,
|
||||
set_websocket: set_websocket_url,
|
||||
load_wasm: load_wasm,
|
||||
wisp: _wisp_connections
|
||||
wisp: _wisp_connections,
|
||||
WebSocket: CurlWebSocket
|
||||
}
|
||||
|
||||
})()
|
Loading…
Add table
Add a link
Reference in a new issue