---
title: "Discussion on \"Comparison between HttpClientFactory and Flurl\" | Hashnode"
description: "Discussion on \"Comparison between HttpClientFactory and Flurl\". The codebase I work with is mixed with greenfield and legacy projects.  Some projects use a static HttpClient (.NET Framework) to avoid socket exceptions and others use Flurl.  For newer projects we use a mix of Flurl and HttpClientFactory (via typed..."
url: "https://hashnode.com/posts/comparison-between-httpclientfactory-and-flurl/607604f09c6b4f29eaec205d"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Comparison between HttpClientFactory and Flurl](https://wind010.hashnode.dev/comparison-between-httpclientfactory-and-flurl?utm_source=hashnode&utm_medium=feed)

The codebase I work with is mixed with greenfield and legacy projects. Some projects use a static HttpClient (.NET Framework) to avoid socket exceptions and others use Flurl. For newer projects we use a mix of Flurl and HttpClientFactory (via typed...

Apr 13, 2021 · 4 min read · wind010.hashnode.dev  
Read the article

-   [#net](https://hashnode.com/tag/net)
-   [#rest-api](https://hashnode.com/tag/rest-api)

## Written by

[Jeff Tong](https://hashnode.com/@Wind010)

@Wind010 · Seattle, WA

  
[View profile](https://hashnode.com/@Wind010)

Software Engineering

I am a developer in Seattle with interests in Security (cyber and IRL), machine learning, and distributed systems.

## Responses 1

Markdown supported · ⌘↵ to post

[Legosiv](https://hashnode.com/@legosiv)

[Apr 7, 2022](https://hashnode.com/posts/comparison-between-httpclientfactory-and-flurl/607604f09c6b4f29eaec205d/comment/624e7a1bacbdc253564c63c6)

Can you show some examples on how you mix flurl and HttpClientFactory? HttpClientFactory is used with dependency injection, do you use flurl inside the same typed client class?

[Jeff Tong](https://hashnode.com/@Wind010)

[Dec 16, 2022](https://hashnode.com/posts/comparison-between-httpclientfactory-and-flurl/607604f09c6b4f29eaec205d/comment/624e7a1bacbdc253564c63c6#reply-639becf9334d0a5bc54bd0b9)

Sorry for the late response. I never check the notifications and the mail is also easy to miss. When I said we have a mix, I mean some clients within the same project uses Flurl and others use HttpClientFactory. We don't mix the HttpClient create from either. If your project requires high load then I would opt for HttpClientFactory since you have more flexibility there. In the projects that use Flurl for the httpclient, we had inherited from the Flurl.DefaultHttpClientFactory to provide resiliency with Polly and Proxy settings with FlurlHttp.Configure.

```
        IHttpClientFactory httpClientFactory;
        if (proxySettings == null)
        {
            httpClientFactory = new PollyHttpClientFactory(resiliencyPolicy, ignoreInvalidSslServerCert);
            logger.Information("Setting up http client factory without proxy.");
        }
        else
        {
            httpClientFactory = new ProxyHttpClientFactory(proxySettings, resiliencyPolicy, ignoreInvalidSslServerCert);
            logger.Information("Setting up http client factory with proxy.");
        }

        FlurlHttp.Configure(delegate (GlobalFlurlHttpSettings settings)
        {
            settings.HttpClientFactory = httpClientFactory;
        });
```
