V2ray/Vmess
از ویکی فارسی اوبونتو
این شیوهنامه برای مبهم سازی ترافیک اینترنتی به منظور فرار از بازرسی بستهٔ عمیق استفاده میشود. شمای ارتباط این شیوهنامه به شکل زیر است:
{browser} <--(socks)--> {V2Ray client inbound <-> V2Ray client outbound} <--(VMess)--> {V2Ray server inbound <-> V2Ray server outbound} <--(Freedom)--> {Target site}
از این شیوهنامه میتوان با افزودنیهای متفاوتی استفاده کرد:
TLS
این افزودنی، نیاز به یک نام دامنه و گواهی مربوط به آن دارد که میتوان از Lets Encrypt تهیه کرد. در این روش ترافیک اینترنتی به صورت ترافیک عادی HTTPS بین کارخواه و کارساز به نظر خواهد رسید.
سمت کارساز
/etc/v2ray/config.json
{
"inbounds": [
{
"port": 443, // recommended port
"protocol": "vmess", // Major incoming protocol
"settings": {
"clients": [
{
"id": "23ad6b10-8d1a-40f7-8ad0-e3e35cd38297", // UUID, must to be kept the same between server and client.
"alterId": 64
}
]
},
"streamSettings": {
"network": "tcp",
"security": "tls", // set security to tls to enable tls feature
"tlsSettings": {
"certificates": [
{
"certificateFile": "/etc/v2ray/v2ray.crt", // certificate file
"keyFile": "/etc/v2ray/v2ray.key" // corresponding private key file
}
]
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
]
}
برای ایجاد UUID میتوان از دستور زیر استفاده کرد:
v2ctl uuid
سمت کارخواه
/etc/v2ray/config.json
{
"inbounds": [
{
"port": 1080, // Listening port
"protocol": "socks", // Incoming protocol is SOCKS 5
"sniffing": {
"enabled": true,
"destOverride": ["http", "tls"]
},
"settings": {
"auth": "noauth" // Authorisation setting of socks protocol. Here, noauth means no authorisation, beacuse in general socks only used in client side, so no need to authorise.
}
}
],
"outbounds": [
{
"protocol": "vmess", // Outcoming protocol
"settings": {
"vnext": [
{
"address": "mydomain.me", // tls needs domain, so fill in your own.
"port": 443, // Server listenning port.
"users": [
{
"id": "23ad6b10-8d1a-40f7-8ad0-e3e35cd38297", // UUID, must be as same as server side
"alterId": 64 // AlterID should be as same as server side
}
]
}
]
},
"streamSettings": {
"network": "tcp",
"security": "tls" // set security to tls to enable tls feature.
}
}
]
}
سوکت وب
یکی از راحتترین روشهای پیکربندی
سمت کارساز
/etc/v2ray/config.json
{
"inbounds": [
{
"port": 16823, // Listening port
"protocol": "vmess", // Major incoming protocol
"settings": {
"clients": [
{
"id": "b831381d-6324-4d53-ad4f-8cda48b30811", // UUID, must to be kept the same between server and client.
"alterId": 64
}
]
},
"streamSettings": {
"network":"ws"
}
}
],
"outbounds": [
{
"protocol": "freedom", // Majoy outcoming protocol.
"settings": {}
}
]
}
سمت کارخواه
/etc/v2ray/config.json
{
"inbounds": [
{
"port": 1080, // Listening port
"protocol": "socks", // Incoming protocol is SOCKS 5
"sniffing": {
"enabled": true,
"destOverride": ["http", "tls"]
},
"settings": {
"auth": "noauth" // Authorisation setting of socks protocol. Here, noauth means no authorisation, beacuse in general socks only used in client side, so no need to authorise.
}
}
],
"outbounds": [
{
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "serveraddr.com",
"port": 16823,
"users": [
{
"id": "b831381d-6324-4d53-ad4f-8cda48b30811",
"alterId": 64
}
]
}
]
},
"streamSettings":{
"network":"ws"
}
}
]
}