File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
395425Apache-2.0
Original file line number Diff line number Diff 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
394424Apache-2.0
You can’t perform that action at this time.
0 commit comments