UiPath Documentation
robot
2022.4
false
机器人用户指南
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

通过代理服务器重定向机器人

如果您的机器人处于封闭网络或并非是 Orchestrator 所使用的网络中,则将无法在两个 UiPath 产品之间实现通信。因此,要实现这种通信,您可以为机器人使用代理服务器。

要通过代理服务器重定向机器人,您必须在机器人计算机上完成一些配置。具体步骤如下:

  • 配置您的首选网页浏览器,以确保机器人计算机可通过指定的代理服务器访问 Orchestrator。

  • 编辑 uipath.config 文件,确保通过提供的代理服务器路由机器人和 Orchestrator 之间的连接,以及通过指定的代理服务器下载活动包和自动化流程。

    备注:

    The user mode robot inherits the Proxy Settings from the Internet Options, while the service mode robot requires specific configuration to be made in the uipath.config file from the Studio installation folder.

    要在用户模式机器人上应用代理设置,您需要重新启动用户主机服务。为此,您可以注销 Windows 用户会话然后重新登录。

    重要提示:

    The settings in the uipath.config file only apply to the robot service process when installed in service-mode. Proxy settings for user-level Windows processes, including the executor (for both user-mode and service-mode installations), are not configurable through uipath.config.

配置代理设置

可以从“Internet 选项”的“连接”部分或“Windows 设置”的“代理设置”菜单中设置代理脚本或代理地址的配置。

配置网页浏览器

  1. In Internet Explorer, click Tools > Internet Options. The Internet Options window is displayed.

  2. In the Connections tab, click LAN Settings. The Local Area Network (LAN) Settings window is displayed. Depending on your setup, you can configure a proxy configuration script or a proxy server.

  3. 配置“代理服务器”或“自动配置”(用于代理脚本)。

  4. 单击“确定”。系统便会保存您的设置。

  5. 在网页浏览器中,输入 Orchestrator URL 以测试连接。

配置 Windows 代理设置

  1. 打开开始菜单,然后搜索“代理设置”

  2. 配置“自动代理设置”(用于代理脚本)或“手动代理设置”(用于代理服务器)。

  3. 保存设置。

  4. 在网页浏览器中,输入 Orchestrator URL 以测试连接。

    重要提示:

    When setting up or editing the proxy address, do not add the http:// prefix to the proxy address. This enables the proxy only for HTTP calls, and since most calls are HTTPS, the proxy configuration fails.

    To resolve this, make sure to either remove the http:// prefix altogether, or specifically add the proxy address with both http:// and https:// prefixes.

    示例:

编辑 uipath.config 文件

  1. 导航至安装文件夹 %ProgramFiles%\UiPath\Studio
  2. 搜索 uipath.config 文件,然后使用 Notepad++ 等文本编辑器打开该文件。
  3. 添加 <webProxySettings> 标签并根据您的代理环境设置值。
    1. 要使用代理脚本,请提供以下键值对:

      <webProxySettings>
          <add key="ScriptAddress" value="http://localhost/proxy.pac" />
      </webProxySettings>
      <webProxySettings>
          <add key="ScriptAddress" value="http://localhost/proxy.pac" />
      </webProxySettings>
      
    2. 要提供代理地址,请提供以下键值对:

      <webProxySettings>
          <add key="ProxyAddress" value="http://1.1.1.1:1234/" />
          <add key="BypassLocalAddresses" value="True" />
          <add key="BypassList" value="server\.domain\.local$;www.google.com;192\.168\.\d{1,3}\.\d{1,3}" />
      </webProxySettings>
      <webProxySettings>
          <add key="ProxyAddress" value="http://1.1.1.1:1234/" />
          <add key="BypassLocalAddresses" value="True" />
          <add key="BypassList" value="server\.domain\.local$;www.google.com;192\.168\.\d{1,3}\.\d{1,3}" />
      </webProxySettings>
      
      备注:

      Starting with v2021.4 Robot, the bypass list should contain an array of regular expression strings that contain the URIs of the servers to bypass.

  4. 保存 uipath.config 文件,然后重新启动机器人服务以使更改生效。

绕过列表的示例

您可以在下面找到绕过列表格式的一些示例。

www.myget.org -> ((www|WWW).){1}?(myget+(.org))
.vo.msecnd.net -> (([a-zA-Z0-9]).)+((vo+)+(.msecnd+)+(.net))
www.nuget.org -> ((www|WWW).){1}?(nuget+(.org))
gallery.uipath.com -> (([a-zA-Z0-9]).)*((gallery+)+(.uipath+)+(.com))
www.myget.org -> ((www|WWW).){1}?(myget+(.org))
.vo.msecnd.net -> (([a-zA-Z0-9]).)+((vo+)+(.msecnd+)+(.net))
www.nuget.org -> ((www|WWW).){1}?(nuget+(.org))
gallery.uipath.com -> (([a-zA-Z0-9]).)*((gallery+)+(.uipath+)+(.com))

要测试复杂配置的格式,您可以使用正则表达式验证器/生成器。

备注:

Starting with v2021.4 Robot, the bypass list should contain an array of regular expression strings that contain the URIs of the servers to bypass.

重要提示:

只能设置 ScriptAddressProxyAddress。如果两者都设置,则 ScriptAddress 优先。

只有设置 ProxyAddress 后,才能设置 BypassListBypassLocalAddresses

Windows 凭据代理身份验证

从 v2021.4.4 开始,机器人可以处理通过 Windows 凭据使用身份验证的代理配置。要启用此功能,请在计算机中添加 UIPATH_PROXY_USE_DEFAULT_CREDENTIALS 系统环境变量。

示例:值为 trueUIPATH_PROXY_USE_DEFAULT_CREDENTIALS

使用 PowerShell 配置 Windows Credentials Proxy 身份验证

  1. 以管理员身份打开 PowerShell。

  2. 运行以下命令:

    [Environment]::SetEnvironmentVariable("UIPATH_PROXY_USE_DEFAULT_CREDENTIALS", "true", "Machine")
    [Environment]::SetEnvironmentVariable("UIPATH_PROXY_USE_DEFAULT_CREDENTIALS", "true", "Machine")
    
  3. 重新启动机器人计算机。

验证脚本

要确认系统环境变量是否已成功设置,请在 PowerShell 中运行以下脚本。

$Env:UIPATH_PROXY_USE_DEFAULT_CREDENTIALS
$Env:UIPATH_PROXY_USE_DEFAULT_CREDENTIALS

随后会返回系统环境变量的值。如果值为 true,则表示配置完成。

基本身份验证

从 v2021.10 版本开始,UiPath 机器人服务支持使用基本身份验证协议的代理服务器。

服务模式机器人

要在机器人以服务模式安装的情况下启用此功能,您需要编辑 uipath.config 文件中的 webProxySettings 部分并添加以下信息:

<webProxySettings>
<add key="ProxyAddress" value="http://my.proxy.net:8008" />
<add key="UserName" value="myUser" />
<add key="Password" value="myPassword" />
<add key="Domain" value="myDomain" />
</webProxySettings>
<webProxySettings>
<add key="ProxyAddress" value="http://my.proxy.net:8008" />
<add key="UserName" value="myUser" />
<add key="Password" value="myPassword" />
<add key="Domain" value="myDomain" />
</webProxySettings>
重要提示:

The Robot Executor does not support proxy configurations using Basic Authentication methods. This means you can use Basic Authentication to connect to Orchestrator and download packages, but not for the actual workflow.

检查代理服务器连接

  1. 将一些包部署到包含先前所配置机器人的环境中。

  2. 导航至 %userprofile%\.nuget\ 文件夹,查看是否已下载相应的流程和活动包。

  3. 运行相应作业,检查是否能成功运行。

    备注:

    从 v2021.4 之前的版本进行更新时,代理配置将从 proxy.config 文件迁移到 uipath.config,以匹配新格式。

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新