mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 09:18:34 +00:00
Outbound: Add outbound sendThrough origin behavior (#4349)
* added support of sending through origin for outbounds * added strings package import * usage of net.SplitHostPort instead of manual splitting --------- Co-authored-by: poly <poly@>
This commit is contained in:
parent
b786a50aee
commit
89792aee9d
2 changed files with 13 additions and 2 deletions
|
@ -292,7 +292,9 @@ func (c *OutboundDetourConfig) Build() (*core.OutboundHandlerConfig, error) {
|
|||
senderSettings.ViaCidr = strings.Split(*c.SendThrough, "/")[1]
|
||||
} else {
|
||||
if address.Family().IsDomain() {
|
||||
return nil, errors.New("unable to send through: " + address.String())
|
||||
if address.Address.Domain() != "origin" {
|
||||
return nil, errors.New("unable to send through: " + address.String())
|
||||
}
|
||||
}
|
||||
}
|
||||
senderSettings.Via = address.Build()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue