1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-10-01 08:16:00 -04:00
v2fly/spec/vmess.md

44 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# VMess 设计
## 摘要
* 版本1
## 数据请求
版本部分:
* 1 字节:版本号,目前为 0x1
认证部分:
* 16 字节md5(用户 VID + 'ASK')
指令部分:
* 1 字节:随机填充长度 M (M <= 32)
* M 字节:随机填充内容
* 1 字节:保留,总是 0x00
* 16 字节:请求数据 IV
* 16 字节:请求数据 Key
* 4 字节:认证信息 V
* 1 字节:指令
* 0x00保留
* 0x01TCP 请求
* 0x02UDP 请求
* 2 字节:目标端口
* 1 字节:目标类型
* 0x01IPv4
* 0x02域名
* 0x03IPv6
* 目标地址:
* 4 字节IPv4
* 1 字节长度 + 域名
* 16 字节IPv6
* 1 字节:随机填充长度 M2 (M2 <= 32)
* M2 字节:随机填充内容
数据部分
* N 字节:请求数据
其中指令部分经过 AES-128 加密Key 为用户 VID数据部分使用 AES-128-CBC 加密
## 数据应答
认证部分:
* 4 字节:认证信息 V
数据部分
* N 字节:应答数据
其中数据部分使用 AES-128-CBC 加密IV 为 md5(请求数据 IV)Key 为 md5(请求数据 Key)