首页 > 编程知识 正文

macos代理服务器,mac设置系统代理

时间:2023-05-03 09:00:33 阅读:214164 作者:3377

mac命令行配置代理服务器

When you configure a proxy server on your Mac, applications will send their network traffic through the proxy server before going to their destination. This may be required by your employer to bypass a firewall, or you may want to use a proxy to bypass geoblocking and access websites that aren’t available in your country.

在Mac上配置代理服务器时,应用程序将在到达目的地之前通过代理服务器发送网络流量。 您的雇主可能需要绕过防火墙,或者您可能想使用代理绕过地理封锁并访问您所在国家/地区不可用的网站。

The proxy server you set here will be used by Apple Safari, Google Chrome, and other applications that respect your system proxy settings. Some applications, including Mozilla Firefox, can have their own custom proxy settings independent from your system settings.

您在此处设置的代理服务器将由Apple Safari,Google Chrome和其他尊重系统代理设置的应用程序使用。 某些应用程序(包括Mozilla Firefox)可以具有独立于您的系统设置的自己的自定义代理设置。

Open the System Preferences application by clicking on it in your Dock, or going to the Apple menu > System Preferences. Click the “Network” icon.

通过在Dock中单击它来打开“系统偏好设置”应用程序,或进入Apple菜单>“系统偏好设置”。 点击“网络”图标。

Select the network connection you use in the list. For example, if you want to configure the proxies used while connected to Wi-Fi networks, select “Wi-Fi”. If you want to configure the proxies used while connected to wired networks, click “Ethernet”.

在列表中选择您使用的网络连接。 例如,如果要配置连接到Wi-Fi网络时使用的代理,请选择“ Wi-Fi”。 如果要配置连接到有线网络时使用的代理,请单击“以太网”。

Click the “Advanced” button at the bottom right corner of the Network window.

单击“网络”窗口右下角的“高级”按钮。

Select the “Proxies” tab. You’ll need to configure a proxy by enabling one or more of the protocol checkboxes here.

选择“代理”标签。 您需要通过在此处启用一个或多个协议复选框来配置代理。

To have your Mac detect whether a proxy is necessary and automatically configure the proxy settings, enable the “Auto Proxy Discover” checkbox. Your Mac will use the Web Proxy Auto Discover protocol, or WPAD, to automatically detect whether a proxy is necessary. This setting may be used on business or school networks, for example.

要让Mac检测是否需要代理并自动配置代理设置,请启用“自动代理发现”复选框。 您的Mac将使用Web代理自动发现协议或WPAD来自动检测是否需要代理。 例如,此设置可用于企业或学校网络。

Even after enabling this option, your Mac will only use a proxy if one is detected using WPAD. If you never want your Mac to use a proxy, even if one is detected with WPAD, leave this box unchecked.

即使启用此选项,Mac也仅在使用WPAD检测到代理时才使用代理。 如果您不希望Mac使用代理,即使使用WPAD检测到了代理,也请不要选中此框。

To use an automatic proxy configuration script, also known as a .PAC file, enable the “Automatic Proxy Configuration” checkbox. Enter the address of the script in the URL box. Your network administrator or proxy provider will provide you with the address to the proxy configuration script, if you need one.

要使用自动代理配置脚本(也称为.PAC文件),请启用“自动代理配置”复选框。 在“ URL”框中输入脚本的地址。 如果需要,您的网络管理员或代理提供商将为您提供代理配置脚本的地址。

If you don’t need to use an automatic proxy configuration script to configure your proxy settings, leave this box unchecked.

如果您不需要使用自动代理配置脚本来配置代理设置,请取消选中此框。

To manually configure a proxy, you’ll need to enable one or more of the “Web Proxy (HTTP)”, “Secure Web Proxy (HTTPS)”, “FTP Proxy”, “SOCKS Proxy”, “Streaming Proxy (RTSP)”, and “Gopher Proxy” checkboxes. Enter the address and port number of the proxy for each option you enable. If you were provided with a username and password for the proxy server, enable the “Proxy server requires password” option and enter the username and password.

要手动配置代理,您需要启用一个或多个“ Web代理(HTTP)”,“安全Web代理(HTTPS)”,“ FTP代理”,“ SOCKS代理”,“流代理(RTSP)” ”和“ Gopher代理”复选框。 输入您启用的每个选项的代理服务器的地址和端口号。 如果为您提供了代理服务器的用户名和密码,请启用“代理服务器需要密码”选项,然后输入用户名和密码。

For example, let’s say you want to configure a proxy that’s used for HTTP, HTTPS, and FTP connections. You’d check the “Web Proxy (HTTP)”, “Secure Web Proxy (HTTPS)”, and “FTP Proxy” boxes. After checking each, you’d enter the address and port of the proxy server into the right pane. If you want to use the same proxy server for all three, you’d enter the same address three times. if you were provided with different proxy server addresses for different protocols, you’d enter different proxy server addresses for these connections.

例如,假设您要配置用于HTTP,HTTPS和FTP连接的代理。 您需要选中“ Web代理(HTTP)”,“安全Web代理(HTTPS)”和“ FTP代理”框。 选中每个复选框后,将在右窗格中输入代理服务器的地址和端口。 如果要对所有三个服务器使用相同的代理服务器,则需要输入三个相同的地址。 如果为不同的协议提供了不同的代理服务器地址,则需要为这些连接输入不同的代理服务器地址。

If you don’t want to manually configure a proxy, ensure all these boxes are unchecked.

如果您不想手动配置代理,请确保所有这些框都未选中。

The remaining settings allow you to bypass the proxy server when connecting to specific addresses and domains you configure.

其余设置可让您在连接到您配置的特定地址和域时绕过代理服务器。

The “Exclude simple hostnames” checkbox allows you to bypass the proxy for all “simple hostnames”. These are often used on local networks and intranets. For example, a network might have a local website at “portal” or a local file server at “fileserver”. In other words, users may have to plug “http://portal/” or “https://fileserver/” into their address bar to access these systems. This type of hostname only works on a local network. By checking this box, you can bypass the proxy for all simple hostnames on networks you connect to.

“排除简单主机名”复选框可让您绕过所有“简单主机名”的代理。 这些通常用于本地网络和Intranet。 例如,网络可能在“门户”上有一个本地网站,或在“文件服务器”上有一个本地文件服务器。 换句话说,用户可能必须将“ http:// portal /”或“ https:// fileserver /”插入其地址栏中才能访问这些系统。 这种类型的主机名仅在本地网络上有效。 通过选中此框,您可以绕过所连接网络上所有简单主机名的代理。

The “Bypass proxy settings for these Hosts & Domains” box contains a list of host names, domain names, and IP address ranges that won’t be accessed through the proxy. For example, it contains “*.local” by default. The “*” here is a wildcard and matches anything. This means anything that ends in .local, including server.local, database.local, and anything.local, will be accessed directly without going through the proxy.

“这些主机和域的绕过代理设置”框包含将无法通过代理访问的主机名,域名和IP地址范围的列表。 例如,默认情况下它包含“ * .local”。 这里的“ *”是通配符,可以匹配任何内容。 这意味着以.local结尾的任何内容(包括server.local,database.local和any.local)都将直接访问,而无需通过代理。

To add your own domain names and addresses, just separate each with a comma and a space. For example, to tell your Mac to access howtogeek.com without going through the proxy, you’d change the line to:

要添加您自己的域名和地址,只需用逗号和空格隔开。 例如,要告诉您的Mac无需通过代理即可访问howtogeek.com,请将行更改为:

*.local, 192.254/16, howtogeek.com

If you have issues connecting to FTP servers after configuring an FTP proxy, ensure the “Use Passive FTP Mode (PASV)” option is enabled at the bottom of the window here. It’s enabled by default.

如果在配置FTP代理后遇到连接FTP服务器的问题,请确保在此处窗口底部启用了“使用被动FTP模式(PASV)”选项。 默认情况下启用。

Click “OK” to save your settings when you’re done. Click “Apply” at the bottom right corner of the Network settings screen and your changes will take effect.

完成后,单击“确定”以保存您的设置。 单击网络设置屏幕右下角的“应用”,您的更改将生效。

If there’s a problem with the proxy server settings—for example, if the proxy server goes down or if you entered the details incorrectly—you’ll see a network error message when using applications like Safari and Google Chrome. For example, Safari will say it can’t find the server you’re trying to access, while Chrome will display a more descriptive “ERR_PROXY_CONNECTION_FAILED” error message. You’ll need to fix your proxy server settings to continue.

如果代理服务器设置存在问题(例如,代理服务器出现故障或输入错误信息),则在使用Safari和Google Chrome等应用程序时会看到网络错误消息。 例如,Safari会说找不到您要访问的服务器,而Chrome会显示更具描述性的“ ERR_PROXY_CONNECTION_FAILED”错误消息。 您需要修复代理服务器设置才能继续。

翻译自: https://www.howtogeek.com/293444/how-to-configure-a-proxy-server-on-a-mac/

mac命令行配置代理服务器

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。