Skip to content

Instantly share code, notes, and snippets.

@megrxu
Last active April 11, 2024 23:57
Show Gist options
  • Star 22 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save megrxu/1ad492eac2d343b4dbd4bb964ca37670 to your computer and use it in GitHub Desktop.
Save megrxu/1ad492eac2d343b4dbd4bb964ca37670 to your computer and use it in GitHub Desktop.
v2ray | WebSocket + VMess/VLess + TLS
{
"inbounds": [
{
"port": 1080,
"listen": "127.0.0.1",
"protocol": "socks",
"settings": {
"udp": false
}
}
],
"outbounds": [
{
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "your-ip-address-or-server-name",
"port": 443,
"users": [
{
"id": "your-uuid"
}
]
}
]
},
"streamSettings": {
"network": "ws",
"security": "tls",
"wsSettings": {
"headers": {
"Host": "your-host"
},
"path": "/vmess"
},
"tlsSettings": {
"serverName": "your-host",
"allowInsecure": false
}
}
},
{
"protocol": "vless",
"settings": {
"vnext": [
{
"address": "your-ip-address-or-server-name",
"port": 443,
"users": [
{
"id": "your-uuid",
"encryption": "none",
"level": 0
}
]
}
]
},
"streamSettings": {
"network": "ws",
"security": "tls",
"wsSettings": {
"headers": {
"Host": "your-host"
},
"path": "/vless"
},
"tlsSettings": {
"serverName": "your-host",
"allowInsecure": false
}
}
},
{
"protocol": "dns",
"settings": {
"network": "tcp",
"address": "1.1.1.1",
"port": 53
}
}
]
}
server {
listen 443 ssl;
ssl_certificate /etc/v2ray/v2ray.crt;
ssl_certificate_key /etc/v2ray/v2ray.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
server_name your-host;
location /vless {
proxy_redirect off;
proxy_pass http://127.0.0.1:12346/vless;
proxy_http_version 1.1;
proxy_set_header Host "your-host";
proxy_set_header Connection "Upgrade";
proxy_set_header Upgrade "WebSocket";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_intercept_errors on;
}
location /vmess {
proxy_redirect off;
proxy_pass http://127.0.0.1:12345/vmess;
proxy_http_version 1.1;
proxy_set_header Host "your-host";
proxy_set_header Connection "Upgrade";
proxy_set_header Upgrade "WebSocket";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_intercept_errors on;
}
location / {
return 204;
}
}
{
"inbounds": [
{
"port": 12345,
"listen": "127.0.0.1",
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "your-uuid"
}
]
},
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/vmess"
}
}
},
{
"port": 12346,
"listen": "127.0.0.1",
"protocol": "vless",
"settings": {
"decryption": "none",
"clients": [
{
"id": "your-uuid",
"level": 0
}
]
},
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/vless"
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
]
}
@olegbliaher
Copy link

Thank you, this is really helpful!

@hieuvn
Copy link

hieuvn commented Mar 25, 2022

Thank you!!!

@Lkhofach
Copy link

Lkhofach commented Mar 3, 2024

Nice

@Lkhofach
Copy link

Lkhofach commented Mar 3, 2024

Top

@Lkhofach
Copy link

Lkhofach commented Mar 3, 2024

Top

@Lkhofach
Copy link

Lkhofach commented Mar 3, 2024

Top

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment