Skip to content

Commit 8d0d06b

Browse files
authored
Update README.md
Implement @antiss11 onion support example
1 parent 6ea28d8 commit 8d0d06b

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,3 +587,30 @@ File blob
587587
}
588588
```
589589
</details>
590+
591+
## Onion Support
592+
593+
Thanks [antis11](https://github.com/antiss11) for an example
594+
595+
<details>
596+
<summary>Example</summary>
597+
598+
```js
599+
import { SocksProxyAgent } from 'socks-proxy-agent';
600+
601+
import FlibustaAPI from 'flibusta';
602+
603+
(async () => {
604+
// eslint-disable-next-line unicorn/no-unreadable-array-destructuring
605+
const [/* original value */, /* path to the file */, authorName] = process.argv;
606+
607+
const flibustaApi = new FlibustaAPI('http://flibustaongezhld6dibs2dps6vm4nvqg2kp7vgowbu76tzopgnhazqd.onion', {
608+
httpAgent: new SocksProxyAgent('socks5h://127.0.0.1:9050'),
609+
});
610+
611+
const searchAuthorsResult = await flibustaApi.getAuthors(authorName);
612+
613+
console.log(JSON.stringify(searchAuthorsResult, undefined, 2));
614+
})();
615+
```
616+
</details>

0 commit comments

Comments
 (0)