feat: search engine adds proxy addresses and adds SSRF verification.

This commit is contained in:
hjz
2026-04-15 08:53:09 +08:00
committed by lyingbug
parent 092044b68f
commit 7bd36bf954
16 changed files with 228 additions and 14 deletions
@@ -23,13 +23,13 @@ type DuckDuckGoProvider struct {
}
// NewDuckDuckGoProvider creates a new DuckDuckGo provider.
// DuckDuckGo is free and requires no API key or configuration.
// DuckDuckGo is free and requires no API key; optional ProxyURL tunnels requests via an HTTP/HTTPS proxy.
func NewDuckDuckGoProvider(params types.WebSearchProviderParameters) (interfaces.WebSearchProvider, error) {
return &DuckDuckGoProvider{
client: &http.Client{
Timeout: 30 * time.Second,
},
}, nil
client, err := NewSearchHTTPClient(30*time.Second, params.ProxyURL)
if err != nil {
return nil, err
}
return &DuckDuckGoProvider{client: client}, nil
}
// Name returns the provider name