mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-09-23 01:27:04 +00:00
https://github.com/XTLS/Xray-core/pull/6327#issuecomment-5645958010 https://github.com/XTLS/Xray-core/pull/6754#issuecomment-5720818254 https://github.com/XTLS/Xray-core/pull/6754#issuecomment-5751585906
24 lines
637 B
Go
24 lines
637 B
Go
package xicmp
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/xtls/xray-core/common/net"
|
|
"github.com/xtls/xray-core/transport/internet/finalmask"
|
|
)
|
|
|
|
func (c *Config) HandleDial() {}
|
|
|
|
func (c *Config) HandleListen() {}
|
|
|
|
func (c *Config) WrapPacketConnClient(conn net.PacketConn, dest *net.Destination, dialer *finalmask.Dialer) (net.PacketConn, error) {
|
|
if dest.Address.Family().IsDomain() && len(c.IPs) == 0 {
|
|
return nil, errors.New("empty ip addresses")
|
|
}
|
|
return NewConnClient(c, dest)
|
|
}
|
|
|
|
func (c *Config) WrapPacketConnServer(conn net.PacketConn, addr net.Addr, lc *finalmask.ListenConfig) (net.PacketConn, error) {
|
|
return NewConnServer(c)
|
|
}
|