mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-25 20:15:01 +03:00
3f7e77e6f8
For a 2022-blake3 method the raw subscription percent-encodes the userinfo, as SIP022 requires. Shadowrocket copies the %2B, %2F and %3D escapes into the node password as they are, so authentication fails for every key that contains +, / or =. A request whose User-Agent is Shadowrocket now gets the userinfo as base64url, the form the other Shadowsocks methods already use and that Shadowrocket reads. Every other client keeps the SIP022 form. Closes #7146
11 lines
300 B
Go
11 lines
300 B
Go
package sub
|
|
|
|
import "regexp"
|
|
|
|
var shadowrocketUserAgentRegex = regexp.MustCompile(`(?i)\bshadowrocket`)
|
|
|
|
// IsShadowrocketClient checks if the client user-agent identifies as Shadowrocket.
|
|
func IsShadowrocketClient(userAgent string) bool {
|
|
return shadowrocketUserAgentRegex.MatchString(userAgent)
|
|
}
|