mirror of
				https://github.com/v2fly/v2ray-examples.git
				synced 2025-11-04 03:45:39 +08:00 
			
		
		
		
	VLESS-TCP-TLS-WS (recommended)
This commit is contained in:
		
							
								
								
									
										9
									
								
								VLESS-TCP-TLS-WS (recommended)/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								VLESS-TCP-TLS-WS (recommended)/README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
# VLESS + TCP + TLS + 回落 + WebSocket(推荐配置)
 | 
			
		||||
 | 
			
		||||
这里是 [最简配置](<https://github.com/v2fly/v2ray-examples/tree/master/VLESS-TCP-TLS%20(minimal%20by%20rprx)>) 的超集,利用 VLESS 强大的回落特性,实现了 443 端口 TCP & WS 的完美共存
 | 
			
		||||
 | 
			
		||||
部署后,你可以同时通过 TCP + TLS 和 WS + TLS 方式连接到服务器,其中 WS 还可以通过 CDN
 | 
			
		||||
 | 
			
		||||
经实测,VLESS 回落分流 WS 比 Nginx 反代 WS 性能更强,传统的 WSS 方案完全可以切换过来
 | 
			
		||||
 | 
			
		||||
你还可以将 WS 上的 VLESS 换成 VMess 等其它任何协议,以及设置更多协议共存,都可以做到
 | 
			
		||||
							
								
								
									
										42
									
								
								VLESS-TCP-TLS-WS (recommended)/config_client_tcp_tls.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								VLESS-TCP-TLS-WS (recommended)/config_client_tcp_tls.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,42 @@
 | 
			
		||||
{
 | 
			
		||||
    "log": {
 | 
			
		||||
        "loglevel": "warning"
 | 
			
		||||
    },
 | 
			
		||||
    "inbounds": [
 | 
			
		||||
        {
 | 
			
		||||
            "port": 10800,
 | 
			
		||||
            "listen": "127.0.0.1",
 | 
			
		||||
            "protocol": "socks",
 | 
			
		||||
            "settings": {
 | 
			
		||||
                "udp": true
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    ],
 | 
			
		||||
    "outbounds": [
 | 
			
		||||
        {
 | 
			
		||||
            "protocol": "vless",
 | 
			
		||||
            "settings": {
 | 
			
		||||
                "vnext": [
 | 
			
		||||
                    {
 | 
			
		||||
                        "address": "example.com", // 换成你的域名或服务器 IP(发起请求时无需解析域名了)
 | 
			
		||||
                        "port": 443,
 | 
			
		||||
                        "users": [
 | 
			
		||||
                            {
 | 
			
		||||
                                "id": "", // 填写你的 UUID
 | 
			
		||||
                                "encryption": "none",
 | 
			
		||||
                                "level": 0
 | 
			
		||||
                            }
 | 
			
		||||
                        ]
 | 
			
		||||
                    }
 | 
			
		||||
                ]
 | 
			
		||||
            },
 | 
			
		||||
            "streamSettings": {
 | 
			
		||||
                "network": "tcp",
 | 
			
		||||
                "security": "tls",
 | 
			
		||||
                "tlsSettings": {
 | 
			
		||||
                    "serverName": "example.com" // 换成你的域名
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    ]
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										45
									
								
								VLESS-TCP-TLS-WS (recommended)/config_client_ws_tls.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								VLESS-TCP-TLS-WS (recommended)/config_client_ws_tls.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,45 @@
 | 
			
		||||
{
 | 
			
		||||
    "log": {
 | 
			
		||||
        "loglevel": "warning"
 | 
			
		||||
    },
 | 
			
		||||
    "inbounds": [
 | 
			
		||||
        {
 | 
			
		||||
            "port": 10800,
 | 
			
		||||
            "listen": "127.0.0.1",
 | 
			
		||||
            "protocol": "socks",
 | 
			
		||||
            "settings": {
 | 
			
		||||
                "udp": true
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    ],
 | 
			
		||||
    "outbounds": [
 | 
			
		||||
        {
 | 
			
		||||
            "protocol": "vless",
 | 
			
		||||
            "settings": {
 | 
			
		||||
                "vnext": [
 | 
			
		||||
                    {
 | 
			
		||||
                        "address": "example.com", // 换成你的域名或服务器 IP(发起请求时无需解析域名了)
 | 
			
		||||
                        "port": 443,
 | 
			
		||||
                        "users": [
 | 
			
		||||
                            {
 | 
			
		||||
                                "id": "", // 填写你的 UUID
 | 
			
		||||
                                "encryption": "none",
 | 
			
		||||
                                "level": 0
 | 
			
		||||
                            }
 | 
			
		||||
                        ]
 | 
			
		||||
                    }
 | 
			
		||||
                ]
 | 
			
		||||
            },
 | 
			
		||||
            "streamSettings": {
 | 
			
		||||
                "network": "ws",
 | 
			
		||||
                "security": "tls",
 | 
			
		||||
                "tlsSettings": {
 | 
			
		||||
                    "serverName": "example.com" // 换成你的域名
 | 
			
		||||
                },
 | 
			
		||||
                "wsSettings": {
 | 
			
		||||
                    "path": "/websocket" // 必须换成自定义的 PATH,需要和服务端的一致
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    ]
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										74
									
								
								VLESS-TCP-TLS-WS (recommended)/config_server.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								VLESS-TCP-TLS-WS (recommended)/config_server.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,74 @@
 | 
			
		||||
{
 | 
			
		||||
    "log": {
 | 
			
		||||
        "loglevel": "warning"
 | 
			
		||||
    },
 | 
			
		||||
    "inbounds": [
 | 
			
		||||
        {
 | 
			
		||||
            "port": 443,
 | 
			
		||||
            "protocol": "vless",
 | 
			
		||||
            "settings": {
 | 
			
		||||
                "clients": [
 | 
			
		||||
                    {
 | 
			
		||||
                        "id": "", // 填写你的 UUID
 | 
			
		||||
                        "level": 0,
 | 
			
		||||
                        "email": "love@v2fly.org"
 | 
			
		||||
                    }
 | 
			
		||||
                ],
 | 
			
		||||
                "decryption": "none",
 | 
			
		||||
                "fallbacks": [
 | 
			
		||||
                    {
 | 
			
		||||
                        "dest": 80
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "path": "/websocket", // 必须换成自定义的 PATH
 | 
			
		||||
                        "dest": 1234,
 | 
			
		||||
                        "xver": 1
 | 
			
		||||
                    }
 | 
			
		||||
                ]
 | 
			
		||||
            },
 | 
			
		||||
            "streamSettings": {
 | 
			
		||||
                "network": "tcp",
 | 
			
		||||
                "security": "tls",
 | 
			
		||||
                "tlsSettings": {
 | 
			
		||||
                    "alpn": [
 | 
			
		||||
                        "http/1.1"
 | 
			
		||||
                    ],
 | 
			
		||||
                    "certificates": [
 | 
			
		||||
                        {
 | 
			
		||||
                            "certificateFile": "/path/to/fullchain.crt", // 换成你的证书,绝对路径
 | 
			
		||||
                            "keyFile": "/path/to/private.key" // 换成你的私钥,绝对路径
 | 
			
		||||
                        }
 | 
			
		||||
                    ]
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "port": 1234,
 | 
			
		||||
            "listen": "127.0.0.1",
 | 
			
		||||
            "protocol": "vless",
 | 
			
		||||
            "settings": {
 | 
			
		||||
                "clients": [
 | 
			
		||||
                    {
 | 
			
		||||
                        "id": "", // 填写你的 UUID
 | 
			
		||||
                        "level": 0,
 | 
			
		||||
                        "email": "love@v2fly.org"
 | 
			
		||||
                    }
 | 
			
		||||
                ],
 | 
			
		||||
                "decryption": "none"
 | 
			
		||||
            },
 | 
			
		||||
            "streamSettings": {
 | 
			
		||||
                "network": "ws",
 | 
			
		||||
                "security": "none",
 | 
			
		||||
                "wsSettings": {
 | 
			
		||||
                    "acceptProxyProtocol": true,
 | 
			
		||||
                    "path": "/websocket" // 必须换成自定义的 PATH,需要和上面的一致
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    ],
 | 
			
		||||
    "outbounds": [
 | 
			
		||||
        {
 | 
			
		||||
            "protocol": "freedom"
 | 
			
		||||
        }
 | 
			
		||||
    ]
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user