mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-09 13:48:41 +00:00
Add domainStrategy to outbound &
Add preferIPv4/6 to domainStrategy
This commit is contained in:
parent
14aa152a8a
commit
ea94d07f65
4 changed files with 223 additions and 64 deletions
|
@ -269,13 +269,14 @@ func (c *InboundDetourConfig) Build() (*core.InboundHandlerConfig, error) {
|
|||
}
|
||||
|
||||
type OutboundDetourConfig struct {
|
||||
Protocol string `json:"protocol"`
|
||||
SendThrough *Address `json:"sendThrough"`
|
||||
Tag string `json:"tag"`
|
||||
Settings *json.RawMessage `json:"settings"`
|
||||
StreamSetting *StreamConfig `json:"streamSettings"`
|
||||
ProxySettings *ProxyConfig `json:"proxySettings"`
|
||||
MuxSettings *MuxConfig `json:"mux"`
|
||||
Protocol string `json:"protocol"`
|
||||
SendThrough *Address `json:"sendThrough"`
|
||||
Tag string `json:"tag"`
|
||||
Settings *json.RawMessage `json:"settings"`
|
||||
StreamSetting *StreamConfig `json:"streamSettings"`
|
||||
ProxySettings *ProxyConfig `json:"proxySettings"`
|
||||
MuxSettings *MuxConfig `json:"mux"`
|
||||
DomainStrategy string `json:"domainStrategy"`
|
||||
}
|
||||
|
||||
func (c *OutboundDetourConfig) checkChainProxyConfig() error {
|
||||
|
@ -295,6 +296,21 @@ func (c *OutboundDetourConfig) Build() (*core.OutboundHandlerConfig, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
switch c.DomainStrategy {
|
||||
case "UseIP":
|
||||
senderSettings.DomainStrategy = proxyman.DomainStrategy_USE_IP
|
||||
case "UseIPv4":
|
||||
senderSettings.DomainStrategy = proxyman.DomainStrategy_USE_IP4
|
||||
case "UseIPv6":
|
||||
senderSettings.DomainStrategy = proxyman.DomainStrategy_USE_IP6
|
||||
case "PreferIPv4":
|
||||
senderSettings.DomainStrategy = proxyman.DomainStrategy_PREFER_IP4
|
||||
case "PreferIPv6":
|
||||
senderSettings.DomainStrategy = proxyman.DomainStrategy_PREFER_IP6
|
||||
default:
|
||||
senderSettings.DomainStrategy = proxyman.DomainStrategy_AS_IS
|
||||
}
|
||||
|
||||
if c.SendThrough != nil {
|
||||
address := c.SendThrough
|
||||
if address.Family().IsDomain() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue