- FoxyPAC от erosman
- Метаданные расширения
- Используется
- Сообщить о нарушении правил этим дополнением
- FoxyPAC от erosman
- Метаданные расширения
- Используется
- Сообщить о нарушении правил этим дополнением
- Proxy Auto Configuration (PAC)
- Proxy Auto-Configuration (PAC) file
- Syntax
- Parameters
- Description
- Return value format
- Examples
- Predefined functions and environment
- isPlainHostName()
- Syntax
- Parameters
- Description
- Examples
- dnsDomainIs()
- Syntax
- Parameters
- Description
- Examples
- localHostOrDomainIs()
- Syntax
- Parameters
- Description
- Examples
- isResolvable()
- Syntax
- Parameters
- Examples
- isInNet()
- Syntax
- Parameters
- Examples
- dnsResolve()
- Parameters
- Example
- convert_addr()
- Syntax
- Parameters
FoxyPAC от erosman
Create, edit, set and export customisable Proxy Auto-Configuration (PAC) easily
Метаданные расширения
Используется
FoxyPAC is a small add-on for creating, editing, setting and exporting customisable Proxy Auto-Configuration (PAC) easily and handle all proxy functions.
Note: None of my extensions contain any tracking, advertising or privacy infringement.
Features
- No need for external/remote PAC, FoxyPAC uses its own internal PAC
- Create a PAC dynamically and set the browser to use that PAC to control proxy connections
- Turn Proxies On/Off from Toolbar Button (v2.0)
- Set ALL through proxy from from Toolbar Button (v2.0)
- Proxy Country Flag (Internal Database)
If proxy is a domain, in Firefox 59, FoxyPAC queries Google Secure DNS-over-HTTPS to get the IP address for the domain without sending any other data/information. A DNS API is added in Firefox 60 but it is not secure yet and once secured the DNS API will be used. - Possible to use it for both Whitelisting or Blacklisting
- Authentication (if required) is prompted by the browser or via saved user/pass (v2.2)
- Greatly simplified Pattern Matching System as well as Regular Expression (v2.0)
- Help Guide included
- Export/Import Preferences (for backup or share) to/from a local file on your computer
- Export PAC (for backup or share) to a local file on your computer
- Import proxies for FoxyProxy clients (v2.2)
Note: The Toolbar button in v1.3 does not come up in FF56.
Permissions Explanation:
- Access your data for all websites: Used to send proxy authentication only if they are set (v2.2)
- Download files and read and modify the browser’s download history: Used only to export PAC/Preference
- Display notifications to you: Used to inform users
- Control browser proxy settings: Used to set PAC (Proxy Auto-config)
Сообщить о нарушении правил этим дополнением
Если вы считаете, что это дополнение нарушает политики Mozilla в отношении дополнений, или имеет проблемы с безопасностью или приватностью, сообщите об этих проблемах в Mozilla, используя эту форму.
Не используйте эту форму, чтобы сообщать об ошибках или запрашивать новые функции в дополнении; это сообщение будет отправлено в Mozilla, а не разработчику дополнения.
Этому дополнению нужно:
- Загружать файлы, а также читать и изменять историю загрузок браузера
- Показывать вам уведомления
- Контролировать настройки прокси в браузере
- Получать доступ к вашим данных на всех сайтах
Источник
FoxyPAC от erosman
Create, edit, set and export customisable Proxy Auto-Configuration (PAC) easily
Метаданные расширения
Используется
FoxyPAC is a small add-on for creating, editing, setting and exporting customisable Proxy Auto-Configuration (PAC) easily and handle all proxy functions.
Note: None of my extensions contain any tracking, advertising or privacy infringement.
Features
- No need for external/remote PAC, FoxyPAC uses its own internal PAC
- Create a PAC dynamically and set the browser to use that PAC to control proxy connections
- Turn Proxies On/Off from Toolbar Button (v2.0)
- Set ALL through proxy from from Toolbar Button (v2.0)
- Proxy Country Flag (Internal Database)
If proxy is a domain, in Firefox 59, FoxyPAC queries Google Secure DNS-over-HTTPS to get the IP address for the domain without sending any other data/information. A DNS API is added in Firefox 60 but it is not secure yet and once secured the DNS API will be used. - Possible to use it for both Whitelisting or Blacklisting
- Authentication (if required) is prompted by the browser or via saved user/pass (v2.2)
- Greatly simplified Pattern Matching System as well as Regular Expression (v2.0)
- Help Guide included
- Export/Import Preferences (for backup or share) to/from a local file on your computer
- Export PAC (for backup or share) to a local file on your computer
- Import proxies for FoxyProxy clients (v2.2)
Note: The Toolbar button in v1.3 does not come up in FF56.
Permissions Explanation:
- Access your data for all websites: Used to send proxy authentication only if they are set (v2.2)
- Download files and read and modify the browser’s download history: Used only to export PAC/Preference
- Display notifications to you: Used to inform users
- Control browser proxy settings: Used to set PAC (Proxy Auto-config)
Сообщить о нарушении правил этим дополнением
Если вы считаете, что это дополнение нарушает политики Mozilla в отношении дополнений, или имеет проблемы с безопасностью или приватностью, сообщите об этих проблемах в Mozilla, используя эту форму.
Не используйте эту форму, чтобы сообщать об ошибках или запрашивать новые функции в дополнении; это сообщение будет отправлено в Mozilla, а не разработчику дополнения.
Этому дополнению нужно:
- Загружать файлы, а также читать и изменять историю загрузок браузера
- Показывать вам уведомления
- Контролировать настройки прокси в браузере
- Получать доступ к вашим данных на всех сайтах
Источник
Proxy Auto Configuration (PAC)
В рунете мало информации об такой замечательной вещи как «Автоматическая настройка прокси сервера». В этой статье я постараюсь подробно остановиться на данном вопросе.
Суть технологии заключается в том, что браузер читает специальный файл написаный на языке JavaScript, в котором определена только одна функция:
function FindProxyForURL(url, host)
<
.
>
где,
url – полный URL запрашиваемого документа
host – имя поста извлекаемое из URL. Этот параметр необходим только для удобства. Он содержит всё от :// и до первого / или :. Номер порта не включается в этот параметр.
Функция возвращает строку содержащую один или несколько способов доступа к запрашиваемому документу. Формат строки следующий:
null — если строка null, то использовать прокси сервер не нужно;
DIRECT — прямое соединение без использования прокси;
PROXY host:port — определяет какой прокси сервер необходимо использовать;
SOCKS host:port — определяет SOCKS сервер который необходимо использовать.
Строка может содержать несколько приведенных выше параметров разделенных точкой с запятой. Тогда браузер будет перебирать их по очереди пока не найдёт доступный прокси сервер.
В главной функции могут быть вызваны следующие функции:
- isPlainHostName(host) возвращает true если строка host не содержит точек («.»).
- dnsDomainIs(host, domain) вернет true если domain принадлежит host
- localHostOrDomainIs(host, hostdomain) возвращает true если строка host (имя хоста или домена) содержится в строке hostdomain
- isResolvable(host) возвращает true если возможно определить IP адрес для заданной строки host
- isInNet(host, pattern, mask) возвращает true если IP адрес или имя хоста в строке host соответствует шаблону pattern и маске mask
- dnsResolve(host) возвращает IP адрес для заданного host
- myIpAddress() возвращает IP адрес компьютера
- dnsDomainLevels(host) возвращает количество точек в строке host. Другими словами уровень домена
- shExpMatch(str, shellexp) вернет true если строка str соответствует регулярному выражению в строке shellexp (формат регулярных выражений shellexp, а не regexp). Например shExpMatch(«a/b/c»,»*/b/*») вернет true
- weekdayRange(wd1 [, wd2 ][, «GMT«]) вернет true если текущая дата или дата заданная в параметре GTM, соответствует заданному дню недели или диапазону дней. Дни недели записываются в закавыченной строке из следующих вариантов (SUN|MON|TUE|WED|THU|FRI|SAT)
- dateRange([day1] [,month1] [,year1] [,day2] [,month2] [,year2] [,»GMT«]) вернет true если текущая дата или дата заданная в параметре GTM попадает в указанный диапазон. Название месяца задается закавыченной строкой из следующих вариантов (JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)
- timeRange(hour1, minute1, second1, hour2, minute2, second2 [, «GMT«])
- timeRange(hour1, minute1, hour2, minute2 [, «GMT«])
- timeRange(hour1, hour2 [, «GMT«])
- timeRange(hour [, «GMT«])
Браузеры Firefox и Internet Explorer поддерживает только системную кодировку в PAC файле и не поддерживают Unicode кодировки, такие как UTF-8.
Источник
Proxy Auto-Configuration (PAC) file
A Proxy Auto-Configuration (PAC) file is a JavaScript function that determines whether web browser requests (HTTP, HTTPS, and FTP) go directly to the destination or are forwarded to a web proxy server. The JavaScript function contained in the PAC file defines the function:
Syntax
Parameters
The URL being accessed. The path and query components of https:// URLs are stripped. In Chrome (versions 52 to 73), you can disable this by setting PacHttpsUrlStrippingEnabled to false in policy or by launching with the —unsafe-pac-url command-line flag (in Chrome 74, only the flag works, and from 75 onward, there is no way to disable path-stripping; as of Chrome 81, path-stripping does not apply to HTTP URLs, but there is interest in changing this behavior to match HTTPS); in Firefox, the preference is network.proxy.autoconfig_url.include_path .
The hostname extracted from the URL. This is only for convenience; it is the same string as between :// and the first : or / after that. The port number is not included in this parameter. It can be extracted from the URL when necessary.
Description
Returns a string describing the configuration. The format of this string is defined in return value format below.
Return value format
- The JavaScript function returns a single string
- If the string is null, no proxies should be used
- The string can contain any number of the following building blocks, separated by a semicolon:
DIRECT
Connections should be made directly, without any proxies
The specified proxy should be used
The specified SOCKS server should be used
Recent versions of Firefox support as well:
The specified proxy should be used
The specified HTTPS proxy should be used
SOCKS4 host:port , SOCKS5 host:port
The specified SOCKS server (with the specified SOCK version) should be used
If there are multiple semicolon-separated settings, the left-most setting will be used, until Firefox fails to establish the connection to the proxy. In that case, the next value will be used, etc.
The browser will automatically retry a previously unresponsive proxy after 30 minutes. Additional attempts will continue beginning at one hour, always adding 30 minutes to the elapsed time between attempts.
If all proxies are down, and there was no DIRECT option specified, the browser will ask if proxies should be temporarily ignored, and direct connections attempted. After 20 minutes, the browser will ask if proxies should be retried, asking again after an additional 40 minutes. Queries will continue, always adding 20 minutes to the elapsed time between queries.
Examples
Primary proxy is w3proxy:8080; if that goes down start using mozilla:8081 until the primary proxy comes up again.
PROXY w3proxy.netscape.com:8080; PROXY mozilla.netscape.com:8081; DIRECT
Same as above, but if both proxies go down, automatically start making direct connections. (In the first example above, Netscape will ask user confirmation about making direct connections; in this case, there is no user intervention.)
PROXY w3proxy.netscape.com:8080; SOCKS socks:1080
Use SOCKS if the primary proxy goes down.
The auto-config file should be saved to a file with a .pac filename extension:
And the MIME type should be set to:
Next, you should configure your server to map the .pac filename extension to the MIME type.
Note:
- The JavaScript function should always be saved to a file by itself but not be embedded in a HTML file or any other file.
- The examples at the end of this document are complete. There is no additional syntax needed to save it into a file and use it. (Of course, the JavaScripts must be edited to reflect your site’s domain name and/or subnets.)
Predefined functions and environment
These functions can be used in building the PAC file:
Note: pactester (part of the pacparser package) was used to test the following syntax examples.
- The PAC file is named proxy.pac
- Command line: pactester -p
/pacparser-master/tests/proxy.pac -u http://www.mozilla.org (passes the host parameter www.mozilla.org and the url parameter http://www.mozilla.org )
isPlainHostName()
Syntax
Parameters
The hostname from the URL (excluding port number).
Description
True if and only if there is no domain name in the hostname (no dots).
Examples
dnsDomainIs()
Syntax
Parameters
Is the hostname from the URL.
Is the domain name to test the hostname against.
Description
Returns true if and only if the domain of hostname matches.
Examples
localHostOrDomainIs()
Syntax
Parameters
The hostname from the URL.
Fully qualified hostname to match against.
Description
Is true if the hostname matches exactly the specified hostname, or if there is no domain name part in the hostname, but the unqualified hostname matches.
Examples
isResolvable()
Syntax
Parameters
is the hostname from the URL.
Tries to resolve the hostname. Returns true if succeeds.
Examples
isInNet()
Syntax
Parameters
a DNS hostname, or IP address. If a hostname is passed, it will be resolved into an IP address by this function.
an IP address pattern in the dot-separated format.
mask for the IP address pattern informing which parts of the IP address should be matched against. 0 means ignore, 255 means match.
True if and only if the IP address of the host matches the specified IP address pattern.
Pattern and mask specification is done the same way as for SOCKS configuration.
Examples
dnsResolve()
Parameters
hostname to resolve.
Resolves the given DNS hostname into an IP address, and returns it in the dot-separated format as a string.
Example
convert_addr()
Syntax
Parameters
Any dotted address such as an IP address or mask.
Concatenates the four dot-separated bytes into one 4-byte word and converts it to decimal.
Источник