iPython R Rapid Miner
В iPython мои (черновики) упражнения с Python, в разделе «Mining» собраны материалы по R, Rapid Miner, Weka, Gate. в «Projects» фрагменты старых и заготовки для новых исследований. записано для себя, открыто для всех.
Поиск по блогу
Страницы
четверг, 8 января 2015 г.
Как подключить системный прокси. In Windows 7 proxycfg.exe has been replaced with the netsh command
Почему «не хочет» работать команда set http_proxy. Именно поэтому. Здесь ссылки, инструкции и примеры для netsh.exe winhttp import proxy source=ie (начинать надо с show proxy). Прокси в Windows можно настроить через WinINET, WinHTTP, использовать WAP — протокол автоматической настройки прокси, или тупо изменить запись в реестре (скриптом).
Здесь ссылки на все случаи проксижизни. и ghbvths команд netsh.
Scrapy and proxies
You need to enable proxy for http and https both. For example in Windows, you can do it directly from shell like
Windows proxy settings explained¶
Applications that have their own proxy settings. The settings must be configured in the application itself and the types of proxies that are supported depends on the application. The application is basically doing a lot of down-level tasks by itself, for example directly using the Winsock library to create TCP connections.
Applications using the WinINET library. WinINET is an API that can be leveraged in order to avoid reinventing the wheel. WinINET is the core of Internet Explorer and can also be used by other applications. Almost all functions available in IE (cookie handling, SSL, authentication, pop ups. ) are available. As such applications using the WinINET library directly take over the same proxy settings as the ones configured in Internet Explorer.
Applications using the WinHTTP library. WinHTTP is more suited for non-interactive usage, such as windows services or background tasks that need to communicate over HTTP where no user-interaction is required. It is a lot faster than the WinINET library. WinHTTP is also easily accessed from .NET based applications making it a popular library for .NET Applications. WinHTTP by default does not use the proxy settings from WinINET.
For both WinINET and WinHTTP, the proxy can be configured using different mechanisms:
proxy auto-configuration scripts
auto-discovery
manual configuration
Proxy Configuration for WinHTTP
By default, WinHTTP does not use the WinINET proxy settings that are defined in IE. The developer using WinHTTP can choose to perform an auto-detect of the proxy server to use, or specify a server manually. When a proxy server is not specified, WinHTTP falls back to the default WinHTTP proxy setting. This can be configured using the NETSH.EXE command line utility.
View current WinHTTP default proxy settings: netsh.exe winhttp show proxy
Set a fixed default WinHTTP proxy server and exclude local addresses: netsh.exe winhttp set proxy
Import the IE proxy settings of the current user as the default WinHTTP settings: netsh.exe winhttp import proxy source=ie
What about x64 and x86 ? When you want to configure the WinHTTP proxy settings for 32-bit applications on a 64-bit platform, you have to start the netsh.exe utility from the C:\Windows\Syswow64\ folder.
Фрагменты с ключами реестра из этой статьи в конце поста
Настройка прокси-сервера Windows 7 — 5 простых шагов
Настройка прокси-сервера Windows 7 — необходимое условие, чтобы играть в игры или выполнять ежедневную работу, связанную с Интернетом. Сегодня мы раскроем секрет о том, как правильно настроить прокси-сервер на Windows 7. Если следовать простой инструкции, то у вас обязательно все получится!
В нашем веке информационных технологий, когда уровень безопасности нахождения в интернете ежедневно снижается, а использование proxy становится «краеугольным камнем» в сохранении персональных данных нетронутыми, актуальным остается вопрос защиты корпоративной сети предприятия, если оно непосредственно завязано на IT. Прокси незаменимы для выполнения задач анализа и сбора данных (так называемый парсинг) в некоторых соцсетях (например, в Вконтакте) и для обхода регионального запрета некоторых ресурсов.
Практически каждый прокси сервер для Windows 7 умеют настраивать как специальные утилиты, так и сама ОС Windows. Давайте рассмотрим один из популярных способов настройки proxy сервера средствами ОС Windows.
Пошаговая инструкция
Итак, для начала заходим в «Панель управления», которую можно найти в меню «Пуск». Далее необходимо выбрать подпункт «Свойства обозревателя» (или «Свойства браузера» в Windows 8.1).
В открытом окне заходим в «Подключения», находим «Настройка сети» и смело жмем.
Ниже необходимо ввести адрес и рабочий порт указанного прокси, а после чего рядом с полем ввода рабочего порта прокси нажать «дополнительно». В открывшемся окне выбираем опцию «один proxy для протоколов». После проделанных процедур и манипуляций с настройками, во время загрузки любого браузера высветится окно ввода «логин-пароль» для указанного вами в настройках proxy. Если вы ставили авторизацию по IP, то дополнительного ввода данных не потребуется.
Если в результате проделанных шагов, что-то пошло не так, повторите все шаги согласно данной инструкции. Возможно где-то что-то было упущено. Если вам нужно настроить прокси-сервер на Windows 10, то учитывайте тот факт, что хоть действия и похожие, однако, все же есть отличия.
В представленном ниже видеообзоре показана подробная пошаговая инструкция, которая также поможет вам правильно настроить прокси в Internet Explorer, включить прокси в Firefox и взаимодействовать с сервером через Chrome.
Netsh.exe and ProxyCfg.exe Proxy Configuration Tools
**WindowsВ Vista and Windows ServerВ 2008:В В **
ProxyCfg.exe has been deprecated. It is replaced by the Netsh.exe winhttp commands.
This topic explains the use of the Microsoft Windows HTTP Services (WinHTTP) proxy configuration tool, «ProxyCfg.exe».
There are two ways to access HTTP and Secure Hypertext Transfer Protocol (HTTPS) servers through a proxy using Microsoft Windows HTTP Services (WinHTTP). First, you can specify proxy settings from within your WinHTTP application. Second, you can specify default proxy settings from outside your application using the proxy configuration utility located in the %windir%\system32 directory.
You can programmatically set the proxy data from within your application or script. If you are writing an application using the WinHTTP API, use one of the following two techniques to change proxy settings.
Use the WinHttpOpen function. Specify access type in the second parameter, the name of the proxy in the third parameter, and a bypass list in the fourth parameter. The following example shows how the WinHttpOpen function can be used to set proxy data.
Use the WinHttpSetOption function. The WINHTTP_OPTION_PROXY flag enables you to specify proxy settings with a WINHTTP_PROXY_INFO structure. The following example code shows how the WinHttpSetOption function can be used to set proxy data.
If you are writing a script or an application using the WinHttpRequest object, use the following technique to change proxy settings.
Use the SetProxy method. Specify the access type in the first parameter, the name of the proxy in the second parameter, and a bypass list in the third parameter. The following example shows how the SetProxy method can be used in script to set proxy data.
To specify default settings and eliminate the need to use either the SetProxy method or the WinHttpSetOption function, use the proxy configuration utility. Using this utility, you can specify that your application access a network either directly, through a proxy, or through a combination of direct and proxy access by specifying a bypass list. When you use the WinHTTP API, the proxy configuration tool only determines the settings when you pass the WINHTTP_ACCESS_TYPE_DEFAULT flag to the WinHttpOpen API. The WinHttpRequest object uses the proxy configuration tool settings by default.
The proxy settings for WinHTTP are not the proxy settings for Microsoft Internet Explorer. You cannot configure the proxy settings for WinHTTP in the Microsoft Windows Control Panel. Using the WinHTTP proxy configuration utility does not alter the settings you use for Internet Explorer.
If you attempt to open and send an HTTP request using WinHTTP and the proxy settings are incorrect, an error occurs.
Command Line Parameters
The following table lists the command line parameters available for use with the ProxyCfg.exe tool.
Parameter | Description |
---|---|
none | When no parameters are specified, the current WinHTTP proxy settings are displayed. |
? | Help information is displayed. |
d | Specifies that WinHTTP applications access the network directly, without a proxy. |
p | Specifies the proxy server. You can also specify an optional list of servers that are accessed without a proxy. |
u | Specifies that WinHTTP applications use the current user’s proxy settings for Internet Explorer. This parameter does not work if Internet Explorer is automatically detecting proxy settings, or if it is using an automatic configuration URL to set the proxy information. |
i | Specifies that WinHTTP applications use the current user’s proxy settings for Internet Explorer. This only works when ProxyCfg.exe was not previously used. If ProxyCfg.exe is installed, specify that the «u» command line parameter use the manual settings. This parameter does not work if Internet Explorer automatically detects proxy settings, or if it uses an automatic configuration URL to set the proxy information. |
You can specify proxies in a space-delimited string. The proxy listings can contain the port number that is used to access the proxy. To list a proxy for a specific protocol, the string must follow the format,
. The valid protocols are HTTP and HTTPS. For example, to list an HTTP proxy, a valid string is http=https://http_proxy_name:80, where http_proxy_name is the name of the proxy server and 80 is the port number that you must use to access the proxy. If the proxy uses the default port number for that protocol, then you can omit the port number. If a proxy name is listed by itself, you can use it as the default proxy for any protocols that do not have a specified proxy. For example, http=https://http_proxy other_proxy uses http_proxy for any HTTP operations, while the HTTPS protocol uses the proxy named other_proxy.
You can list locally known host names or IP addresses in the proxy bypass list. This list can contain wildcards, such as «*», that cause the application to bypass the proxy server for addresses that fit the specified pattern, for example, «*.microsoft.com» or «*.org». Wildcard characters must be the left-most characters in the list. For example, «aaa.*» is not supported. To list multiple addresses and host names, separate them with blank spaces or semicolons in the proxy bypass string. If you specify the macro, the function bypasses any host name that does not contain a period.
After Proxycfg.exe runs, you cannot restore the previous proxy settings. However, you can remove the proxy settings entirely.
Usage
To use the proxy configuration tool, open a command prompt window and run the proxy configuration utility with the appropriate command line parameters. The following section provides syntax examples.
Example Syntax
Example 1: Use a proxy only for external resources
The following is the most common use for Proxycfg.exe. This command specifies that both HTTP and HTTPS servers are accessed through the proxy server named «proxy_server», except for host names that do not contain a period.
proxycfg -p proxy_server » «
Example 2: Use a proxy for all resources
The following example specifies that both HTTP and HTTPS servers are accessed through the proxy server named «proxy_server». No bypass list is specified.
proxycfg -p proxy_server
Example 3: Use a different proxy for secure resources
The following example specifies that HTTP servers are accessed through the http_proxy proxy and HTTPS servers are accessed through https_proxy. Local intranet sites and any site in the *.microsoft.com domain bypass the proxy.
proxycfg -p «http=http_proxy https=https_proxy» » ;*.microsoft.com»
Removing ProxyCfg.exe
After using the proxy configuration tool, you cannot restore your original proxy settings. However, if necessary, you can remove the registry settings that the utility creates. To remove the registry entries that ProxyCfg.exe creates, you must delete the WinHttpSettings value from the following registry key.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\WinHttpSettings
Deleting the WinHttpSettings value removes all proxy configurations.
ProxyCfg.exe and Authentication
The proxy configuration utility sets the default authentication policy. Because you should not perform NTLM authentication with untrusted hosts, by default, NTLM authentication only occurs automatically with hosts on the proxy bypass list. If there is no proxy, you can still use ProxyCfg.exe to specify a bypass list of hosts that you trust to perform NTLM authentication. A proxy name is required when using ProxyCfg.exe for this purpose, but you can use any valid string in place of a real proxy name.
For more information about the auto-logon policy, see Automatic Logon Policy.