| 1 | { |
| 2 | "description": "Shared proxy validation samples for Property C parity tests (TS <-> Python). Keep the schema stable; update _is_valid_proxy in server/app.py and isValidProxy in Settings.tsx together when adding new patterns.", |
| 3 | "samples": [ |
| 4 | { "input": "", "expected": { "isValid": true } }, |
| 5 | { "input": "http://127.0.0.1:7890", "expected": { "isValid": true, "scheme": "http" } }, |
| 6 | { "input": "http://proxy.example.com:8080", "expected": { "isValid": true, "scheme": "http" } }, |
| 7 | { "input": "http://user:pass@proxy.example.com:8080", "expected": { "isValid": true, "scheme": "http" } }, |
| 8 | { "input": "http://10.0.0.1:3128", "expected": { "isValid": true, "scheme": "http" } }, |
| 9 | { "input": "http://[::1]:8080", "expected": { "isValid": true, "scheme": "http" } }, |
| 10 | { "input": "http://localhost:7890", "expected": { "isValid": true, "scheme": "http" } }, |
| 11 | { "input": "http://user:pass@127.0.0.1:8080", "expected": { "isValid": true, "scheme": "http" } }, |
| 12 | { "input": "http://[::1]", "expected": { "isValid": true, "scheme": "http" } }, |
| 13 | { "input": "https://proxy.example.com", "expected": { "isValid": true, "scheme": "https" } }, |
| 14 | { "input": "https://secure-proxy.internal:8443", "expected": { "isValid": true, "scheme": "https" } }, |
| 15 | { "input": "https://proxy.corp.example.com:443", "expected": { "isValid": true, "scheme": "https" } }, |
| 16 | { "input": "https://127.0.0.1:8443", "expected": { "isValid": true, "scheme": "https" } }, |
| 17 | { "input": "socks5://127.0.0.1:1080", "expected": { "isValid": true, "scheme": "socks5" } }, |
| 18 | { "input": "socks5://user@proxy:1080", "expected": { "isValid": true, "scheme": "socks5" } }, |
| 19 | { "input": "socks5://127.0.0.1", "expected": { "isValid": true, "scheme": "socks5" } }, |
| 20 | { "input": "socks5h://dnsresolver:1080", "expected": { "isValid": true, "scheme": "socks5h" } }, |
| 21 | { "input": "socks5h://[fe80::1]:1080", "expected": { "isValid": true, "scheme": "socks5h" } }, |
| 22 | { "input": "socks5h://example.com", "expected": { "isValid": true, "scheme": "socks5h" } }, |
| 23 | { "input": "ftp://proxy.example.com", "expected": { "isValid": false } }, |
| 24 | { "input": "ws://example.com", "expected": { "isValid": false } }, |
| 25 | { "input": "socks://127.0.0.1", "expected": { "isValid": false } }, |
| 26 | { "input": "socks4://127.0.0.1", "expected": { "isValid": false } }, |
| 27 | { "input": "tcp://127.0.0.1", "expected": { "isValid": false } }, |
| 28 | { "input": "rsync://example.com", "expected": { "isValid": false } }, |
| 29 | { "input": "javascript:alert(1)", "expected": { "isValid": false } }, |
| 30 | { "input": "file:///tmp/x", "expected": { "isValid": false } }, |
| 31 | { "input": "proxy.example.com:8080", "expected": { "isValid": false } }, |
| 32 | { "input": "127.0.0.1:7890", "expected": { "isValid": false } }, |
| 33 | { "input": "example.com", "expected": { "isValid": false } }, |
| 34 | { "input": "http://", "expected": { "isValid": false } }, |
| 35 | { "input": "https://", "expected": { "isValid": false } }, |
| 36 | { "input": "socks5://", "expected": { "isValid": false } }, |
| 37 | { "input": "socks5h://", "expected": { "isValid": false } }, |
| 38 | { "input": "http:// ", "expected": { "isValid": false } }, |
| 39 | { "input": "http:// ", "expected": { "isValid": false } }, |
| 40 | { "input": " ", "expected": { "isValid": false } }, |
| 41 | { "input": "\t", "expected": { "isValid": false } }, |
| 42 | { "input": "\n", "expected": { "isValid": false } }, |
| 43 | { "input": "http:/missing-slash.com", "expected": { "isValid": false } }, |
| 44 | { "input": "://no-scheme.com", "expected": { "isValid": false } }, |
| 45 | { "input": "http//missing-colon.com", "expected": { "isValid": false } }, |
| 46 | { "input": "htp://example.com", "expected": { "isValid": false } }, |
| 47 | { "input": " http://example.com ", "expected": { "isValid": false } }, |
| 48 | { "input": "HTTP://EXAMPLE.COM", "expected": { "isValid": false } }, |
| 49 | { "input": "HtTp://example.com", "expected": { "isValid": false } } |
| 50 | ] |
| 51 | } |
| 52 |