<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

        时间:2023-07-11

        <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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:ASP.NET 核心,更改未经授权的默认重定向 下一篇:在 ASP.NET Core 中未经授权时重定向到登录

                  相关文章

                    <bdo id='bgTtc'></bdo><ul id='bgTtc'></ul>

                  <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>