fix: Support http://host:port:user:pass proxy format in bulk import
Add regex pattern to parseProxyLine() for non-standard colon-separated format used by some proxy providers (e.g., Evomi residential proxies). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -511,6 +511,18 @@ function AddProxyForm({ onClose, onSuccess }: { onClose: () => void; onSuccess:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Format: protocol://host:port:username:password (non-standard colon format from some providers)
|
||||||
|
match = line.match(/^(https?|socks5):\/\/([^:]+):(\d+):([^:]+):(.+)$/);
|
||||||
|
if (match) {
|
||||||
|
return {
|
||||||
|
protocol: match[1],
|
||||||
|
host: match[2],
|
||||||
|
port: parseInt(match[3]),
|
||||||
|
username: match[4],
|
||||||
|
password: match[5]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Format: protocol://host:port
|
// Format: protocol://host:port
|
||||||
match = line.match(/^(https?|socks5):\/\/([^:]+):(\d+)$/);
|
match = line.match(/^(https?|socks5):\/\/([^:]+):(\d+)$/);
|
||||||
if (match) {
|
if (match) {
|
||||||
@@ -742,7 +754,7 @@ function AddProxyForm({ onClose, onSuccess }: { onClose: () => void; onSuccess:
|
|||||||
<textarea
|
<textarea
|
||||||
value={bulkText}
|
value={bulkText}
|
||||||
onChange={(e) => setBulkText(e.target.value)}
|
onChange={(e) => setBulkText(e.target.value)}
|
||||||
placeholder={'Supported formats:\nhost:port\nprotocol://host:port\nhost:port:username:password\nprotocol://username:password@host:port\n\nExample:\n192.168.1.1:8080\nhttp://proxy.example.com:3128\n10.0.0.1:8080:user:pass\nsocks5://user:pass@proxy.example.com:1080'}
|
placeholder={'Supported formats:\nhost:port\nprotocol://host:port\nhost:port:username:password\nprotocol://host:port:username:password\nprotocol://username:password@host:port\n\nExample:\n192.168.1.1:8080\nhttp://proxy.example.com:3128\n10.0.0.1:8080:user:pass\nhttp://proxy.com:1000:user:pass123\nsocks5://user:pass@proxy.example.com:1080'}
|
||||||
rows={12}
|
rows={12}
|
||||||
className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 font-mono text-sm"
|
className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 font-mono text-sm"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user