mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-11-25 11:01:44 +00:00
https://github.com/XTLS/Xray-core/pull/6748#issuecomment-5752780799 https://github.com/XTLS/Xray-core/issues/7240#issuecomment-6439951754 https://github.com/XTLS/Xray-core/pull/4231#issuecomment-6679992732 https://github.com/XTLS/Xray-core/pull/7355#issuecomment-6739539943 https://github.com/XTLS/Xray-core/pull/7359#issuecomment-6742147165 https://github.com/XTLS/Xray-core/pull/7364#issuecomment-6784892866 https://github.com/XTLS/Xray-core/pull/7364#issuecomment-6812285253 https://github.com/XTLS/Xray-core/pull/7364#issuecomment-6842747639 https://github.com/XTLS/Xray-core/pull/4231#issuecomment-7012427059 https://github.com/XTLS/Xray-core/pull/7364#issuecomment-7108550396 https://github.com/XTLS/Xray-core/pull/7364#issuecomment-7129493942 https://github.com/XTLS/Xray-core/pull/7364#issuecomment-7130454962 --------- Co-authored-by: Codex <codex@users.noreply.github.com> Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
23 lines
463 B
Go
23 lines
463 B
Go
package reverse
|
|
|
|
import (
|
|
"crypto/rand"
|
|
"io"
|
|
|
|
"github.com/xtls/xray-core/common/dice"
|
|
"github.com/xtls/xray-core/common/net"
|
|
)
|
|
|
|
func (c *Control) FillInRandom() {
|
|
randomLength := dice.Roll(64)
|
|
randomLength++
|
|
c.Random = make([]byte, randomLength)
|
|
io.ReadFull(rand.Reader, c.Random)
|
|
}
|
|
|
|
const internalDomain = "reverse"
|
|
|
|
func isInternalDomain(dest net.Destination) bool {
|
|
return dest.Address.Family().IsDomain() && dest.Address.Domain() == internalDomain
|
|
}
|