Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lgou2w committed Feb 6, 2023
1 parent e5ab4ca commit c8fd94d
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,36 @@ const picacomic = new PicaComicClient({
})()
```

## 常见问题

### 如何配置 HTTP 代理

> 另见 Got:[agent](https://github.com/sindresorhus/got/tree/v11#agent).
请配置 `PicaComicAPIOptions``PicaComicClientOptions``fetch` 属性。

使用 [tunnel](https://github.com/koichik/node-tunnel) 的例子:

```typescript
import { PicaComicClient } from '@l2studio/picacomic-api'
import tunnel from 'tunnel'

const picacomic = new PicaComicClient({
fetch: {
agent: {
https: tunnel.httpsOverHttp({
// 你的 Http 代理服务器主机和端口
proxy: {
host: '127.0.0.1',
port: 10809
}
}) as any
}
},
...other
})
```

## 协议

Apache-2.0
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,36 @@ const picacomic = new PicaComicClient({
})()
```

## FAQ

### How to configure http proxy

> See also Got [agent](https://github.com/sindresorhus/got/tree/v11#agent).
Please configure the `fetch` property of `PicaComicAPIOptions` or `PicaComicClientOptions`.

Example using [tunnel](https://github.com/koichik/node-tunnel):

```typescript
import { PicaComicClient } from '@l2studio/picacomic-api'
import tunnel from 'tunnel'

const picacomic = new PicaComicClient({
fetch: {
agent: {
https: tunnel.httpsOverHttp({
// Your http proxy server host and port
proxy: {
host: '127.0.0.1',
port: 10809
}
}) as any
}
},
...other
})
```

## License

Apache-2.0

0 comments on commit c8fd94d

Please sign in to comment.