mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-13 06:20:02 -04:00
improve fetch api compatibility
This commit is contained in:
parent
baab0aea8f
commit
563a2b7310
6 changed files with 79 additions and 23 deletions
10
README.md
10
README.md
|
@ -41,6 +41,12 @@ let r = await libcurl.fetch("https://ading.dev");
|
|||
console.log(await r.text());
|
||||
```
|
||||
|
||||
Most of the standard Fetch API's features are supported, with the exception of:
|
||||
- CORS enforcement
|
||||
- `FormData` or `URLSearchParams` as the request body
|
||||
- Sending credentials/cookies automatically
|
||||
- Caching
|
||||
|
||||
### Changing the Websocket URL:
|
||||
You can change the URL of the websocket proxy by using `libcurl.set_websocket`.
|
||||
```js
|
||||
|
@ -53,8 +59,8 @@ The proxy server consists of a standard [Wisp](https://github.com/MercuryWorksho
|
|||
To host the proxy server, run the following commands:
|
||||
```
|
||||
git clone https://github.com/ading2210/libcurl.js --recursive
|
||||
cd libcurl.js/server
|
||||
./run.sh
|
||||
cd libcurl.js
|
||||
STATIC=$(pwd)/client server/run.sh
|
||||
```
|
||||
|
||||
You can use the `HOST` and `PORT` environment variables to control the hostname and port that the proxy server listens on.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue