New proxy regexp
This commit is contained in:
parent
2f6e49bec0
commit
9cf2d765aa
1 changed files with 4 additions and 4 deletions
|
@ -95,11 +95,11 @@ proxifiedContainers = {
|
|||
|
||||
// Parses a proxy description string of the format type://host[:port] or type://username:password@host[:port] (port is optional)
|
||||
parseProxy(proxy_str, mozillaVpnData = null) {
|
||||
const proxyRegexp = /(?<type>(https?)|(socks4?)):\/\/(\b(?<username>\w+):(?<password>\w+)@)?(?<host>((?:\d{1,3}\.){3}\d{1,3}\b)|(\b([\w.-]+)(\.([\w.-]+))+))(:(?<port>\d+))?/;
|
||||
if (proxyRegexp.test(proxy_str) !== true) {
|
||||
const proxyRegexp = /(?<type>(https?)|(socks4?)):\/\/(\b(?<username>\w+):(?<password>\w+)@)?(?<host>((?:\d{1,3}\.){3}\d{1,3}\b)|(\b([\w.-]+)+))(:(?<port>\d+))?/;
|
||||
const matches = proxyRegexp.exec(proxy_str);
|
||||
if (!matches) {
|
||||
return false;
|
||||
}
|
||||
const matches = proxyRegexp.exec(proxy_str);
|
||||
|
||||
if (mozillaVpnData && mozillaVpnData.mozProxyEnabled === undefined) {
|
||||
matches.groups.type = "direct";
|
||||
|
|
Loading…
Add table
Reference in a new issue