feat: support socks5h scheme for proxy settings

This commit is contained in:
Lemon
2026-04-07 07:46:11 +08:00
parent ada8e2905e
commit 163d68318f
3 changed files with 25 additions and 3 deletions
+2 -2
View File
@@ -58,7 +58,7 @@ func Parse(raw string) (Setting, error) {
}
switch parsedURL.Scheme {
case "socks5", "http", "https":
case "socks5", "socks5h", "http", "https":
setting.Mode = ModeProxy
setting.URL = parsedURL
return setting, nil
@@ -95,7 +95,7 @@ func BuildHTTPTransport(raw string) (*http.Transport, Mode, error) {
case ModeDirect:
return NewDirectTransport(), setting.Mode, nil
case ModeProxy:
if setting.URL.Scheme == "socks5" {
if setting.URL.Scheme == "socks5" || setting.URL.Scheme == "socks5h" {
var proxyAuth *proxy.Auth
if setting.URL.User != nil {
username := setting.URL.User.Username()