generated from kedaya_haitao/template
feat UrlToMetadata
This commit is contained in:
parent
a581c72a65
commit
23dc1eaeff
@ -51,7 +51,7 @@ func HTTPGetViaProxy(ctx context.Context, clashProxy C.Proxy, url string) error
|
|||||||
ctx, cancel := context.WithTimeout(ctx, time.Duration(config.Config.HealthCheckTimeout)*time.Second)
|
ctx, cancel := context.WithTimeout(ctx, time.Duration(config.Config.HealthCheckTimeout)*time.Second)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
addr, err := urlToMetadata(url)
|
addr, err := UrlToMetadata(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -107,7 +107,7 @@ func HTTPGetViaProxy(ctx context.Context, clashProxy C.Proxy, url string) error
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func urlToMetadata(rawURL string) (addr C.Metadata, err error) {
|
func UrlToMetadata(rawURL string) (addr C.Metadata, err error) {
|
||||||
u, err := url.Parse(rawURL)
|
u, err := url.Parse(rawURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user