Outbound: Fix sendthrough srcip precheck (#4750)

Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
This commit is contained in:
Aubrey Yang 2025-06-06 10:54:15 +09:00 committed by GitHub
parent af7a76da67
commit 028e1114e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 12 deletions

View file

@ -292,7 +292,8 @@ func (c *OutboundDetourConfig) Build() (*core.OutboundHandlerConfig, error) {
senderSettings.ViaCidr = strings.Split(*c.SendThrough, "/")[1]
} else {
if address.Family().IsDomain() {
if address.Address.Domain() != "origin" {
domain := address.Address.Domain()
if domain != "origin" && domain != "srcip" {
return nil, errors.New("unable to send through: " + address.String())
}
}