mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
545 B
34 lines
545 B
package io
|
|
|
|
import (
|
|
"net"
|
|
)
|
|
|
|
// VMessInput implements the input message of VMess protocol.
|
|
type VMessInput struct {
|
|
version byte
|
|
userHash [16]byte
|
|
randHash [256]byte
|
|
respKey [32]byte
|
|
iv [16]byte
|
|
command byte
|
|
port uint16
|
|
target [256]byte
|
|
data []byte
|
|
}
|
|
|
|
type VMessReader struct {
|
|
conn *net.Conn
|
|
}
|
|
|
|
func NewVMessReader(conn *net.Conn) (VMessReader, error) {
|
|
var reader VMessReader
|
|
reader.conn = conn
|
|
return reader, nil
|
|
}
|
|
|
|
func (*VMessReader) Read() (VMessInput, error) {
|
|
var input VMessInput
|
|
return input, nil
|
|
}
|