mirror of https://github.com/v2ray/v2ray-core
				
				
				
			update vmess format
							parent
							
								
									7c20b392d4
								
							
						
					
					
						commit
						1e9b8a2cdd
					
				| 
						 | 
				
			
			@ -1,9 +1,19 @@
 | 
			
		|||
package net
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
  "net"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type VMessHandler struct {
 | 
			
		||||
  
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (*VMessHandler) Listen(port uint8) error {
 | 
			
		||||
  listener, err := net.Listen("tcp", ":" + string(port))
 | 
			
		||||
  if err != nil {
 | 
			
		||||
    return err
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
  
 | 
			
		||||
  return nil
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,6 +13,7 @@
 | 
			
		|||
* 1 字节:保留,总是 0x00
 | 
			
		||||
* 16 字节:请求数据 IV
 | 
			
		||||
* 16 字节:响应数据 IV
 | 
			
		||||
* 4 字节:认证信息 V
 | 
			
		||||
* 1 字节:指令
 | 
			
		||||
  * 0x00:保留
 | 
			
		||||
  * 0x01:TCP 请求
 | 
			
		||||
| 
						 | 
				
			
			@ -32,10 +33,8 @@
 | 
			
		|||
其中指令部分经过 AES-256 加密,Key 为 left(用户 VID, 32);数据部分使用块密码加密
 | 
			
		||||
 | 
			
		||||
## 数据应答
 | 
			
		||||
版本部分:
 | 
			
		||||
* 1 字节:版本号,目前为 0x1
 | 
			
		||||
认证部分:
 | 
			
		||||
* 16 字节:md5(用户 VID + 'ANS')
 | 
			
		||||
* 4 字节:认证信息 V
 | 
			
		||||
数据部分
 | 
			
		||||
* N 字节:应答数据
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue