How to check the IP of a computer proxy
On the Internet, many users use proxy servers to access the network in order to protect their privacy or access some blocked websites. And in the process of using a proxy server, sometimes we need to know the address and port number of the proxy server, the following is how to view the address and port of the computer proxy server.
First of all, we can check the address and port number of the proxy server under Windows OS by following these steps:
1. Open the Control Panel, type "Internet Options" in the search box, and then click Enter.
2. In the pop-up window, switch to the "Connections" tab and click the "LAN Settings" button.
3. In the LAN Settings window, if "Use automatic configuration scripts" and "Use automatic detection settings" are checked, the "Proxy server" column will display If "Use Auto Configuration Script" and "Use Auto Detect Settings" are checked, the address and port number of the proxy server will be displayed in the "Proxy Server" column.
And to view the address and port number of the proxy server under MacOS, you can follow the steps below:
1. Click the Apple icon in the upper left corner of the screen and select "System Preferences".
2. In the pop-up window, find and click on "Network".
3. Select the connected network and click Advanced.
4. Switch to the "Proxy" tab. If the proxy is enabled, the address and port number will be displayed in the corresponding input boxes.
How to check the address and port of a computer proxy server
In some cases, we may need to programmatically look up the address and port of a computer's proxy server. The following is an example in Python to demonstrate how to get the address and port number of a proxy server through code:
import winreg
def get_proxy_info(): key = winreg.
key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'SoftwareMicrosoftWindowsCurrentVersionInternet Settings')
server, type = winreg.QueryValueEx(key, 'ProxyServer')
key.Close()
key.Close() return server
proxy_info = get_proxy_info()
print(proxy_info)
The above code accesses the Windows registry to get the address and port number of the proxy server and then prints it out. In this way, we can dynamically get the proxy server information in the program, which is convenient for subsequent operations.
Languages other than Python can be used in a similar way to obtain the address and port number of a proxy server for different situations.