mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-18 23:00:12 +00:00
handle inbound detour in vmess inbound
This commit is contained in:
1 parent
573d0a9c29
commit
b0adb24003
13 files changed
+163
-75
No files matched your search
@@ -26,20 +26,16 @@ type CacheDns struct {
|
||||
Address v2net.Address
|
||||
}
|
||||
|
||||
func (this *CacheDns) Marshal(writer io.Writer) (int, error) {
|
||||
func (this *CacheDns) Marshal(writer io.Writer) {
|
||||
if this.Address.IsIPv4() {
|
||||
writer.Write([]byte{typeIPv4})
|
||||
writer.Write(this.Address.IP())
|
||||
return 5, nil
|
||||
}
|
||||
|
||||
if this.Address.IsIPv6() {
|
||||
writer.Write([]byte{typeIPv6})
|
||||
writer.Write(this.Address.IP())
|
||||
return 17, nil
|
||||
}
|
||||
|
||||
return 0, ErrDomainAddress
|
||||
}
|
||||
|
||||
func (this *CacheDns) Unmarshal(data []byte) error {
|
||||
|
||||
Reference in new issue
Block a user