This article describes parsing different proxy links into xray outbound configs. Using tools like hopsayer's vless link parser , we can create tool to parse free proxy lists and run xray with resulting config.
1. VLESS
Link Format: vless://UUID@HOST:PORT?params#NAME
Parsing Steps:
- Extract UUID (user ID) from before
@ - Extract host and port from between
@and? - Parse query parameters (encryption, flow, type, security, sni, host, path, etc.)
- Extract fragment as display name
Xray Outbound Mapping:
{
"protocol": "vless",
"settings": {
"vnext": [{
"address": host,
"port": port,
"users": [{
"id": UUID,
"encryption": params.get("encryption", "none"),
"flow": params.get("flow"), # For XTLS
"security": "auto"
}]
}]
},
"streamSettings": create_stream_settings(params),
"tag": unique_tag
}2. VMESS
Link Format: vmess://BASE64_ENCODED_JSON
Parsing Steps:
- Base64 decode the entire payload
- Parse as JSON containing:
{add, port, id, net, type, host, path, tls, sni, alpn, fp, ps} - Map field names (supports both short and long names)
Xray Outbound Mapping:
{
"protocol": "vmess",
"settings": {
"vnext": [{
"address": vmess_config["add"],
"port": vmess_config["port"],
"users": [{
"id": vmess_config["id"],
"alterId": vmess_config.get("aid", 0),
"security": vmess_config.get("scy", "auto")
}]
}]
},
"streamSettings": create_stream_settings(params),
"tag": unique_tag
}3. Trojan
Link Format: trojan://PASSWORD@HOST:PORT?params#NAME
Parsing Steps:
- Extract password from before
@ - Extract host and port from between
@and? - Parse query parameters (type, security, sni, etc.)
- Defaults:
type=tcp,security=tls
Xray Outbound Mapping:
{
"protocol": "trojan",
"settings": {
"servers": [{
"address": host,
"port": port,
"password": password,
"level": 0
}]
},
"streamSettings": create_stream_settings(params),
"tag": unique_tag
}Key Difference: Uses servers array instead of vnext (like VLESS/VMESS).
4. Shadowsocks
Link Format: ss://BASE64(METHOD:PASSWORD)@HOST:PORT#NAME
Parsing Steps:
- Detect encoding type (fully encoded vs partially encoded)
- Base64 decode to get
METHOD:PASSWORD@HOST:PORT - Extract method (encryption), password, host, and port
- Extract fragment as name
Xray Outbound Mapping:
{
"protocol": "shadowsocks",
"settings": {
"servers": [{
"address": host,
"port": port,
"method": encryption_method,
"password": password,
"uot": False,
"level": 0
}]
},
"streamSettings": {
"network": "tcp",
"security": "none"
},
"tag": unique_tag
}Key Difference: Shadowsocks uses simple TCP/no security for streamSettings (doesn't use create_stream_settings()).