#proxy #http-request #setup #helper #ip #up #brightdata

brightdata_proxy

A simple helper library which helps you set up a brightdata proxy which you can use with the reqwest library

2 releases

0.1.1 Sep 26, 2024
0.1.0 Jun 12, 2024

#55 in #up

Download history 184/week @ 2024-09-25 13/week @ 2024-10-02 7/week @ 2024-10-09 4/week @ 2024-10-16 3/week @ 2024-10-30 5/week @ 2024-11-06

75 downloads per month

MIT license

4KB

brightdata-proxy

Description

A simple helper library which helps you set up a brightdata proxy which you can use with the reqwest library.

Example

A fully working example can be found here.

// Create a proxy builder
let proxy_builder = BrightdataProxyBuilder::builder()
    .username(username)
    .password(password)
    .build();

// Create a new proxy
// 1 session = 1 ip, as long as you use the same client you'll keep the same IP
// NOTE: you can only keep the same ip for 60 seconds, see docs: https://docs.brightdata.com/api-reference/proxy/rotate_ips
let proxy = proxy_builder
    .create_new_session()
    .context("create new proxy session")?;

// Build your request client and use as usual
let client = ClientBuilder::new()
    .proxy(proxy)
    .build()
    .context("build http client")?;

Dependencies

~4–15MB
~190K SLoC