• Flutter代理设置


    flutter/bin/cache/pkg/sky_engine/lib/_http/http.dart -> HttpClient

    //示例:
       var httpClient = new HttpClient();
        httpClient.findProxy = (url) {
          return HttpClient.findProxyFromEnvironment(url, environment: {
            "http_proxy": "192.168.3.76:8888",
            "https_proxy": "192.168.3.76:8888",
            "HTTP_PROXY": "192.168.3.76:8888",
            "HTTPS_PROXY": "192.168.3.76:8888",
          });
        };
    //描述
    /**
       * Function for resolving the proxy server to be used for a HTTP
       * connection from the proxy configuration specified through
       * environment variables.
       *
       * The following environment variables are taken into account:
       *
       *     http_proxy
       *     https_proxy
       *     no_proxy
       *     HTTP_PROXY
       *     HTTPS_PROXY
       *     NO_PROXY
       *
       * [:http_proxy:] and [:HTTP_PROXY:] specify the proxy server to use for
       * http:// urls. Use the format [:hostname:port:]. If no port is used a
       * default of 1080 will be used. If both are set the lower case one takes
       * precedence.
       *
       * [:https_proxy:] and [:HTTPS_PROXY:] specify the proxy server to use for
       * https:// urls. Use the format [:hostname:port:]. If no port is used a
       * default of 1080 will be used. If both are set the lower case one takes
       * precedence.
       *
       * [:no_proxy:] and [:NO_PROXY:] specify a comma separated list of
       * postfixes of hostnames for which not to use the proxy
       * server. E.g. the value "localhost,127.0.0.1" will make requests
       * to both "localhost" and "127.0.0.1" not use a proxy. If both are set
       * the lower case one takes precedence.
       *
       * To activate this way of resolving proxies assign this function to
       * the [findProxy] property on the [HttpClient].
       *
       *     HttpClient client = new HttpClient();
       *     client.findProxy = HttpClient.findProxyFromEnvironment;
       *
       * If you don't want to use the system environment you can use a
       * different one by wrapping the function.
       *
       *     HttpClient client = new HttpClient();
       *     client.findProxy = (url) {
       *       return HttpClient.findProxyFromEnvironment(
       *           url, environment: {"http_proxy": ..., "no_proxy": ...});
       *     }
       *
       * If a proxy requires authentication it is possible to configure
       * the username and password as well. Use the format
       * [:username:password@hostname:port:] to include the username and
       * password. Alternatively the API [addProxyCredentials] can be used
       * to set credentials for proxies which require authentication.
       */
    
    • 通过Charles可以查看抓包信息,
    • Charles -> Help -> Local IP Address可以看到本机代理ip 地址
  • 相关阅读:
    ASP.NET MVC5写.php路由匹配时的问题 ASP.NET MVC 4 在 .NET 4.0 与.NET 4.5 的專案範本差異
    asp.net mvc上传头像加剪裁功能介绍
    图片延迟加载实现
    c#中多线程访问winform控件的若干问题
    C# WinForm实现控件拖动实例介绍
    C# 实现对窗体(Form)换肤
    C#读写txt文件的两种方法介绍
    C#实现JSON序列化与反序列化介绍
    高效的VS调试技巧
    SQL 添加字段和默认值脚本
  • 原文地址:https://www.cnblogs.com/wwoo/p/flutter-dai-li-she-zhi.html
Copyright © 2020-2023  润新知