如何设置和使用代理服务器?

17 Mar 2025 | 6 分钟阅读

代理服务器在计算机和互联网之间充当桥梁。它可以使互联网运行得更快,并提供更多的安全性和隐私。在本节中,我们将学习如何在 Windows PC 和浏览器中设置代理服务器。此外,我们还将学习如何使用代理服务器。

Training Institute

如何设置代理服务器?

Windows 10中,默认情况下代理设置会自动检测。我们也可以手动设置代理。设置代理的基本方法是使用应由组织网络管理员维护的脚本地址。另一种方法是设置一个自动配置脚本。让我们看看如何在 Windows 和浏览器中设置代理服务器

在 Internet Explorer 中设置代理服务器

与其他浏览器一样,Internet Explorer 也使用默认的 Windows 代理配置。让我们看看步骤。

  1. 打开Internet Explorer。
  2. 点击右上角的工具图标。
    How to set up and use a proxy server
  3. 从菜单中选择Internet 选项。这会打开一个对话框。
    How to set up and use a proxy server
  4. 在对话框中,点击连接选项卡。
    How to set up and use a proxy server
  5. 点击局域网设置按钮。
    How to set up and use a proxy server
  6. 代理服务器标签下,勾选为此 LAN 使用代理服务器,如下图所示。
    How to set up and use a proxy server
  7. 提供您想使用的代理服务器的地址端口。在我们的例子中,我们提供了地址91.132.139.178,端口为3128。您可以选择其他端口。
    How to set up and use a proxy server
  8. 点击确定按钮保存设置。
    How to set up and use a proxy server

一切完成!我们已经设置了代理服务器。现在我们可以匿名访问互联网了。

在 Google Chrome 中设置代理服务器

默认情况下,Chrome 会使用 Windows 代理和 macOS。如果我们想更改代理设置,请按照以下步骤操作。

  1. 打开Chrome浏览器。
  2. 点击右上角的三个点
    How to set up and use a proxy server
  3. 在菜单中,选择设置选项。这会打开 Chrome 设置页面。
    How to set up and use a proxy server
  4. 向下滚动页面,点击高级选项。
    How to set up and use a proxy server
  5. 再次向下滚动页面,在系统标签下点击打开您的计算机代理设置。这会打开Internet 属性对话框。
    How to set up and use a proxy server
  6. 在对话框中,点击连接选项卡。
    How to set up and use a proxy server
  7. 点击局域网设置按钮。
    How to set up and use a proxy server
  8. 代理服务器标签下,勾选为此 LAN 使用代理服务器,如下图所示。
    How to set up and use a proxy server
  9. 提供您想使用的代理服务器的地址端口。在我们的例子中,我们提供了地址91.132.139.178,端口为3128。您可以选择其他端口。
    How to set up and use a proxy server
  10. 点击确定按钮保存设置。
    How to set up and use a proxy server

一切完成!我们已经设置了代理服务器。现在我们可以匿名访问互联网了。此外,我们还注意到浏览器中只需执行几个步骤,然后就可以在您计算机的操作系统中进行后续操作。

在 Edge 浏览器中设置代理服务器

Microsoft Edge 是 Windows 10 的内置 Web 浏览器。除非我们告诉它关于代理的信息,否则它会使用 Windows 代理配置。这与 Chrome 相同,因此代理配置也类似。让我们看看在 Microsoft Edge 浏览器中设置代理服务器的步骤。

  1. 打开Microsoft Edge浏览器。
  2. 点击右上角的三个点
    How to set up and use a proxy server
  3. 在菜单中,选择设置选项。这会打开 Edge 设置页面。
    How to set up and use a proxy server
  4. 点击左侧窗格中的系统选项。
    How to set up and use a proxy server
  5. 系统标签下点击打开您的计算机代理设置。这会打开Internet 属性对话框。
    How to set up and use a proxy server
  6. 在对话框中,点击连接选项卡。
    How to set up and use a proxy server
  7. 点击局域网设置按钮。
    How to set up and use a proxy server
  8. 代理服务器标签下,勾选为此 LAN 使用代理服务器,如下图所示。
    How to set up and use a proxy server
  9. 提供您想使用的代理服务器的地址端口。在我们的例子中,我们提供了地址91.132.139.178,端口为3128。您可以选择其他端口。
    How to set up and use a proxy server
  10. 点击确定按钮保存设置。
    How to set up and use a proxy server

一切完成!我们已经设置了代理服务器。现在我们可以匿名访问互联网了。此外,我们还注意到浏览器中只需执行几个步骤,然后就可以在您计算机的操作系统中进行后续操作。

在 Firefox 中设置代理服务器

与其他浏览器一样,Firefox 不使用系统的默认代理设置。如果我们想在 Firefox 中使用代理,我们应该按照以下步骤操作。

  1. 打开Firefox浏览器。
  2. 点击右上角的三个水平线
    How to set up and use a proxy server
  3. 选择选项菜单。
    How to set up and use a proxy server
  4. 向下滚动页面,转到网络设置。点击设置?按钮。这会打开连接设置对话框。
    How to set up and use a proxy server
  5. 该对话框显示了配置代理访问互联网的多种选项,如下所示:
    • 不使用代理:如果选择此项,则不设置代理。
    • 自动检测此网络的代理设置:此选项会自动检测您正在使用的网络的代理设置。
    • 使用系统代理设置:它会使用操作系统的代理设置。
    • 手动配置代理:通过选择此部分,我们可以通过提供 HTTP、HTTPS、FTP 代理以及相应的端口来手动设置代理。

    在我们的例子中,我们选择了自动检测此网络的代理设置选项。

    How to set up and use a proxy server
  6. 选择以上任一选项后,点击确定按钮保存设置。
    How to set up and use a proxy server

一切完成!我们已经设置了代理服务器。现在我们可以匿名访问互联网了。

在 Windows 中自动设置代理服务器

在 Windows 中自动设置代理服务器包括以下步骤:

  1. 打开控制面板。
  2. 选择Internet 选项。这会打开 Internet 选项对话框。
    How to set up and use a proxy server
  3. 在对话框中,点击连接选项卡。
    How to set up and use a proxy server
  4. 点击局域网设置按钮。
    How to set up and use a proxy server
  5. 自动配置标签下,勾选使用自动配置脚本选项,如下图所示。
    How to set up and use a proxy server
  6. 在地址框中提供指定的脚本地址。在我们的例子中,脚本地址是 file://c:/proxy.pac。因为我们在C:\目录下创建了一个名为PROXY.PAC的文件(请参见下文),其中包含代理配置文件。您可以选择您喜欢的目录。
    How to set up and use a proxy server
  7. 点击确定按钮保存设置。
    How to set up and use a proxy server

一切完成!我们已经设置了代理服务器。现在我们可以匿名访问互联网了。

PROXY.PAC

有时浏览器需要从保存为PROXY.PAC(PAC 代表 Proxy Auto Configuration,代理自动配置)的配置文件中读取代理设置。该文件包含代理设置,但也可以用于其他一些情况。例如,负载均衡、容错等。

我们可以根据需要对 PROXY.PAC 文件进行任何更改。在下面的脚本中,我们看到定义了多个 URL 以绕过代理,而所有其他 URL 都定义为通过代理。

创建配置文件后,我们可以继续执行步骤 6 和 7。

在 Windows 中手动设置代理服务器

在 Windows 中自动设置代理服务器包括以下步骤:

  1. 打开控制面板。
  2. 选择Internet 选项。这会打开 Internet 选项对话框。
    How to set up and use a proxy server
  3. 在对话框中,点击连接选项卡。
    How to set up and use a proxy server
  4. 点击局域网设置按钮。
    How to set up and use a proxy server
  5. 代理服务器标签下,勾选为此 LAN 使用代理服务器选项,如下图所示。
    How to set up and use a proxy server
  6. 点击高级按钮。
    How to set up and use a proxy server
  7. 代理设置对话框中,提供要使用的代理地址(HTTP、FTP、安全、Socks)及其端口。在我们的例子中,我们提供了以下信息:
    • HTTP 代理:192.168.1.100,端口:80
    • FTP 代理:192.168.1.100,端口:80
    • 安全代理:192.168.1.100,端口:80
    • Socks 代理:192.168.1.100,端口:1080

    How to set up and use a proxy server
  8. 点击确定按钮保存更改。
    How to set up and use a proxy server

一切完成!让我们检查代理是否有效。

打开浏览器并输入 https://whatismyipaddress.com/。它会显示系统的 IP 地址。下图显示了在使用代理之前的系统 IP 地址。

How to set up and use a proxy server

当我们设置代理时,系统的 IP 地址会更改为一个不同的地址。

如何使用代理服务器?

设置代理后,我们可以像以前一样访问互联网。唯一的变化是系统的 IP 地址会改变。

何时应该使用代理服务器?

如果我们想实现以下任何目标,就应该使用代理服务器:

  • 阻止互联网协议
  • 阻止 Cookies
  • 绕过防火墙
  • 压缩流量
  • 缓存网站
  • 移除广告
  • 阻止恶意软件
  • 移除定制内容
  • 访问深度网络
  • 国际购物
  • 访问娱乐内容