How to turn off global proxy settings

Ah, guys, today we're going to talk about how to turn off global proxy settings. Sometimes we need to connect to the Internet during programming, and the global proxy will make our network requests go a long way, causing the speed to slow down. What should we do? Let's take a look together!


View current proxy settings

Before we start to turn off the global proxy, the first thing to do is to check the current proxy settings. In most operating systems, we can view it through the command line or graphical interface. Let's take a look at a simple example. If you are using macOS, you can open the terminal and enter the following command: ``` networksetup -getwebproxy Wi-Fi ``` This command will display the current Wi-Fi proxy settings, including the proxy's IP address, port, and other information. With this information, we can confirm whether the global proxy is currently enabled.


Turn off global proxy

Now we come to the highlight, how to turn off the global proxy? In fact, the method is also very simple. In most cases, we only need to change the proxy settings to empty. Continuing with macOS as an example, you can use the following commands to turn off the proxy: ``` networksetup -setwebproxystate Wi-Fi off networksetup -setsecurewebproxystate Wi-Fi off ``` These two commands will turn off the proxy settings for HTTP and HTTPS respectively. After turning it off, we run the command in the first step again to view the proxy settings and confirm that the proxy has been turned off.


Modify system settings

Sometimes, even if we turn off the global proxy, there may still be some residual settings in the system, causing some applications to still go through the proxy. At this time, we need to manually modify the system settings to ensure that all network requests no longer go through the proxy. In macOS, you can open "System Preferences" - "Network", select the currently connected network (such as Wi-Fi), click "Advanced", and uncheck all proxy options in the "Proxy" tab.


Restart network service

Finally, to ensure that all changes take effect, sometimes we need to restart the network service. You can restart the network service with the following command: ``` sudo service network-manager restart ``` In this way, the previous network settings will be reloaded and all proxy settings will be cleared. At this point, the global proxy is successfully turned off! I hope the above content can help everyone and let everyone have a smooth journey on the road of programming.

[email protected]