Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dns overrides with a function #1441

Closed
wants to merge 2 commits into from

Conversation

niuhuan
Copy link
Contributor

@niuhuan niuhuan commented Jan 14, 2022

Can overrides dns with a function

reqwest::ClientBuilder::new()
    .resolve_fn(move |domain| {
        if Regex::new(r"(.+\.)?abc\.com")
            .unwrap()
            .is_match(domain.as_str())
        {
            Some("1.2.3.4:443".parse().unwrap())
        } else {
            None
        }
    })
    .build()
    .unwrap();

@niuhuan niuhuan marked this pull request as ready for review January 14, 2022 07:14
@niuhuan niuhuan mentioned this pull request Jan 14, 2022
@niuhuan
Copy link
Contributor Author

niuhuan commented Jan 14, 2022

Implement #1125
Dear @seanmonstar , I finished it as the issue poster said, only adding some necessary code to keep it clean, is this OK?.

src/connect.rs Outdated Show resolved Hide resolved
src/connect.rs Show resolved Hide resolved
src/async_impl/client.rs Show resolved Hide resolved
src/async_impl/client.rs Outdated Show resolved Hide resolved
@timokoesters
Copy link

timokoesters commented Feb 9, 2022

We're using these changes in conduit.rs without any problems.

@niuhuan
Copy link
Contributor Author

niuhuan commented Feb 10, 2022

We're using these changes in conduit.rs without any problems.

Maybe not merge. author has not discussed it. 😛

@niuhuan niuhuan closed this Nov 15, 2022
@ShadowJonathan
Copy link

ShadowJonathan commented Nov 15, 2022

Why was this closed?

Edit: ah, there's another PR

@niuhuan
Copy link
Contributor Author

niuhuan commented Nov 15, 2022

#1653

I think asynchronous parsing is more popular, I'm learning to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants