<i id='Lu568'><tr id='Lu568'><dt id='Lu568'><q id='Lu568'><span id='Lu568'><b id='Lu568'><form id='Lu568'><ins id='Lu568'></ins><ul id='Lu568'></ul><sub id='Lu568'></sub></form><legend id='Lu568'></legend><bdo id='Lu568'><pre id='Lu568'><center id='Lu568'></center></pre></bdo></b><th id='Lu568'></th></span></q></dt></tr></i><div id='Lu568'><tfoot id='Lu568'></tfoot><dl id='Lu568'><fieldset id='Lu568'></fieldset></dl></div>
      <bdo id='Lu568'></bdo><ul id='Lu568'></ul>

      1. <small id='Lu568'></small><noframes id='Lu568'>

      2. <tfoot id='Lu568'></tfoot>
      3. <legend id='Lu568'><style id='Lu568'><dir id='Lu568'><q id='Lu568'></q></dir></style></legend>

        asp.net core defaultProxy

        asp.net core defaultProxy(asp.net core defaultProxy)

        <tfoot id='ro3W0'></tfoot>

              <legend id='ro3W0'><style id='ro3W0'><dir id='ro3W0'><q id='ro3W0'></q></dir></style></legend>
              <i id='ro3W0'><tr id='ro3W0'><dt id='ro3W0'><q id='ro3W0'><span id='ro3W0'><b id='ro3W0'><form id='ro3W0'><ins id='ro3W0'></ins><ul id='ro3W0'></ul><sub id='ro3W0'></sub></form><legend id='ro3W0'></legend><bdo id='ro3W0'><pre id='ro3W0'><center id='ro3W0'></center></pre></bdo></b><th id='ro3W0'></th></span></q></dt></tr></i><div id='ro3W0'><tfoot id='ro3W0'></tfoot><dl id='ro3W0'><fieldset id='ro3W0'></fieldset></dl></div>

              • <small id='ro3W0'></small><noframes id='ro3W0'>

                  <tbody id='ro3W0'></tbody>
                • <bdo id='ro3W0'></bdo><ul id='ro3W0'></ul>

                  本文介绍了asp.net core defaultProxy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在 net 4.5 中,我们正在使用这样的代理:

                  In net 4.5 we are working with proxy like this:

                  <system.net>
                      <!-- -->
                      <defaultProxy enabled="true" useDefaultCredentials="false">
                          <proxy usesystemdefault="True" proxyaddress="http://192.168.1.1:8888" bypassonlocal="True" autoDetect="False" />
                          <module type="CommonLibrary.Proxy.MyProxy, CommonLibrary, Version=1.0.0.0, Culture=neutral" />
                      </defaultProxy>
                  
                      <settings>
                          <httpWebRequest useUnsafeHeaderParsing="true" />
                          <servicePointManager expect100Continue="false" />
                      </settings>
                  </system.net>
                  

                  但是在 asp.net core 或 test 中我们找不到像上面这样的解决方案有人可以帮我吗?

                  but in asp.net core or test we can't found a solution like the above Could someone please help me?

                  非常感谢您的帮助

                  谢谢,问候

                  推荐答案

                  虽然在可以使用 HttpClientHander 时手动设置代理工作,但默认所有请求都不需要代码,就像你可以在 .NET Framework 中做目前是不可能的.如果您使用的是不公开此功能的库,那就太可惜了.

                  Whilst manually setting the proxy works when it's possible to use a HttpClientHander, defaulting all requests to do so without code, like you could do in the .NET Framework is currently not possible. Which is bummer if you're using a library that doesn't expose this functionality.

                  谢天谢地,从 .NET Core 3.0 开始,只需设置环境变量就可以实现这一点(即,其行为与 Linux 一直有效):https://github.com/dotnet/corefx/issues/37187

                  Thankfully, from .NET Core 3.0, this will be possible simply by setting environment variables (i.e. behaves exactly as Linux has worked forever): https://github.com/dotnet/corefx/issues/37187

                  或者,https://github.com/dotnet/corefx/issues/36553 在 HttpClient 上添加了一个新的静态 DefaultWebProxy 属性,这将允许您通过代码完成相同的事情.这也将在 Core 3.0 中提供.

                  Alternatively, https://github.com/dotnet/corefx/issues/36553 added a new static DefaultWebProxy property on HttpClient that will allow you to accomplish the same thing via code. This will also be available in Core 3.0.

                  这篇关于asp.net core defaultProxy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Performance overhead of using attributes in .NET(在 .NET 中使用属性的性能开销)
                  Accessing attribute info from DTE(从 DTE 访问属性信息)
                  c# Hide a property in datagridview with datasource(c#使用数据源隐藏datagridview中的属性)
                  Extract Display name and description Attribute from within a HTML helper(从 HTML 帮助器中提取显示名称和描述属性)
                  C# Attributes and their uses(C# 属性及其用途)
                  C# - Getting all enums value by attribute(C# - 按属性获取所有枚举值)
                    <bdo id='bgTtc'></bdo><ul id='bgTtc'></ul>

                        <tbody id='bgTtc'></tbody>
                      <tfoot id='bgTtc'></tfoot>

                      • <i id='bgTtc'><tr id='bgTtc'><dt id='bgTtc'><q id='bgTtc'><span id='bgTtc'><b id='bgTtc'><form id='bgTtc'><ins id='bgTtc'></ins><ul id='bgTtc'></ul><sub id='bgTtc'></sub></form><legend id='bgTtc'></legend><bdo id='bgTtc'><pre id='bgTtc'><center id='bgTtc'></center></pre></bdo></b><th id='bgTtc'></th></span></q></dt></tr></i><div id='bgTtc'><tfoot id='bgTtc'></tfoot><dl id='bgTtc'><fieldset id='bgTtc'></fieldset></dl></div>

                          <small id='bgTtc'></small><noframes id='bgTtc'>

                        1. <legend id='bgTtc'><style id='bgTtc'><dir id='bgTtc'><q id='bgTtc'></q></dir></style></legend>