Skip to content

Commit c8fd94d

Browse files
committed
chore: update readme
1 parent e5ab4ca commit c8fd94d

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

README-CN.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,36 @@ const picacomic = new PicaComicClient({
390390
})()
391391
```
392392

393+
## 常见问题
394+
395+
### 如何配置 HTTP 代理
396+
397+
> 另见 Got:[agent](https://github.com/sindresorhus/got/tree/v11#agent).
398+
399+
请配置 `PicaComicAPIOptions``PicaComicClientOptions``fetch` 属性。
400+
401+
使用 [tunnel](https://github.com/koichik/node-tunnel) 的例子:
402+
403+
```typescript
404+
import { PicaComicClient } from '@l2studio/picacomic-api'
405+
import tunnel from 'tunnel'
406+
407+
const picacomic = new PicaComicClient({
408+
fetch: {
409+
agent: {
410+
https: tunnel.httpsOverHttp({
411+
// 你的 Http 代理服务器主机和端口
412+
proxy: {
413+
host: '127.0.0.1',
414+
port: 10809
415+
}
416+
}) as any
417+
}
418+
},
419+
...other
420+
})
421+
```
422+
393423
## 协议
394424

395425
Apache-2.0

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,36 @@ const picacomic = new PicaComicClient({
389389
})()
390390
```
391391

392+
## FAQ
393+
394+
### How to configure http proxy
395+
396+
> See also Got [agent](https://github.com/sindresorhus/got/tree/v11#agent).
397+
398+
Please configure the `fetch` property of `PicaComicAPIOptions` or `PicaComicClientOptions`.
399+
400+
Example using [tunnel](https://github.com/koichik/node-tunnel):
401+
402+
```typescript
403+
import { PicaComicClient } from '@l2studio/picacomic-api'
404+
import tunnel from 'tunnel'
405+
406+
const picacomic = new PicaComicClient({
407+
fetch: {
408+
agent: {
409+
https: tunnel.httpsOverHttp({
410+
// Your http proxy server host and port
411+
proxy: {
412+
host: '127.0.0.1',
413+
port: 10809
414+
}
415+
}) as any
416+
}
417+
},
418+
...other
419+
})
420+
```
421+
392422
## License
393423

394424
Apache-2.0

0 commit comments

Comments
 (0)