multi-account-containers
multi-account-containers copied to clipboard
Unable to ser IPv6 proxy IP
- Multi-Account Containers Version: 8.0.2
- Operating System + Version: Ubuntu Linux 21.10 amd64
- Firefox Version: 94.0
- Other installed Add-ons + Version + Enabled/Disabled-Status:
Actual behavior
When I try to user proxy in container, I'm able to set only IPv4 address [ ie.: socks4://127.0.0.1:1080 ]
Expected behavior
use IPv6 proxy address [ ie.: socks4://[::1]:1080 ]
Steps to reproduce
- use some IPv6 ( ie.: SSH .ssh/config DynamixForward [::1]:1080 ) not necessary because problem is with interface
- try to set advanced proxy settings address ( socks4://[::1]:1080 )
- Error message will shows "Please enter a valid proxy URL"
Notes
A year later, this is still an actual problem.
It also seems a simple fix:
diff --git a/src/js/proxified-containers.js b/src/js/proxified-containers.js
index d6b7a40..97ba9ca 100644
--- a/src/js/proxified-containers.js
+++ b/src/js/proxified-containers.js
@@ -44,7 +44,7 @@ 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.-]+)+))(:(?<port>\d+))?/;
+ const proxyRegexp = /(?<type>(https?)|(socks4?)):\/\/(\b(?<username>[\w-]+):(?<password>[\w-]+)@)?(?<host>((?:\d{1,3}\.){3}\d{1,3}\b)|(\b([\w.-]+)+)|(\[([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\]))(:(?<port>\d+))?/;
const matches = proxyRegexp.exec(proxy_str);
if (!matches) {
return false;
Or, a lot shorter:
diff --git a/src/js/proxified-containers.js b/src/js/proxified-containers.js
index d6b7a40..de7e6ab 100644
--- a/src/js/proxified-containers.js
+++ b/src/js/proxified-containers.js
@@ -44,7 +44,7 @@ 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.-]+)+))(:(?<port>\d+))?/;
+ const proxyRegexp = /(?<type>(https?)|(socks4?)):\/\/(\b(?<username>[\w-]+):(?<password>[\w-]+)@)?(?<host>((?:\d{1,3}\.){3}\d{1,3}\b)|(\b([\w.-]+)+)|(\[[a-f0-9:]+\]))(:(?<port>\d+))?/;
const matches = proxyRegexp.exec(proxy_str);
if (!matches) {
return false;