mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-12 14:00:01 -04:00
fix error handling, allow building an es6 module
This commit is contained in:
parent
e4c064401e
commit
bb31ef120f
4 changed files with 26 additions and 4 deletions
|
@ -14,7 +14,7 @@ git clone https://github.com/ading2210/libcurl.js
|
|||
cd libcurl.js/client
|
||||
./build.sh
|
||||
```
|
||||
Make sure you have emscripten, git, and the various C build tools installed. The build script will generate `client/out/libcurl.js`.
|
||||
Make sure you have emscripten, git, and the various C build tools installed. The build script will generate `client/out/libcurl.js` as well as `client/out/libcurl_module.mjs`, which is an ES6 module.
|
||||
|
||||
## Javascript API:
|
||||
|
||||
|
@ -41,6 +41,12 @@ let r = await libcurl.fetch("https://ading.dev");
|
|||
console.log(await r.text());
|
||||
```
|
||||
|
||||
### Changing the Websocket URL:
|
||||
You can change the URL of the websocket proxy by using `libcurl.set_websocket`.
|
||||
```js
|
||||
libcurl.set_websocket("ws://localhost:6001/");
|
||||
```
|
||||
|
||||
## Proxy Server:
|
||||
The proxy server consists of a [SOCKS5 proxy server](https://github.com/Amaindex/asyncio-socks-server) behind a [websocket TCP proxy](https://github.com/novnc/websockify).
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue