mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 03:10:42 +08:00
feat: 统一服务缓存 + 指纹驱动插件匹配
将 webServiceCache 扩展为通用 serviceCache,所有指纹识别结果 统一缓存,插件匹配时端口不命中则回退到服务名称匹配。 删除多余的 service_cache.go,复用已有的 ServiceInfo 体系。 补充 nil 防御、Explicit 标记、大量单元/集成/回归测试。
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -106,7 +107,7 @@ func configureHTTPProxy(tr *http.Transport, legacyProxy string, networkConfig *c
|
||||
} else if httpProxyURL == ProxyShortcutSocks5 {
|
||||
httpProxyURL = ProxySocks5URL
|
||||
} else if !strings.Contains(httpProxyURL, "://") {
|
||||
httpProxyURL = "http://127.0.0.1:" + httpProxyURL
|
||||
httpProxyURL = normalizeHTTPProxyURL(httpProxyURL)
|
||||
}
|
||||
|
||||
// 验证代理类型
|
||||
@@ -127,6 +128,13 @@ func configureHTTPProxy(tr *http.Transport, legacyProxy string, networkConfig *c
|
||||
return nil
|
||||
}
|
||||
|
||||
func normalizeHTTPProxyURL(proxyURL string) string {
|
||||
if _, err := strconv.Atoi(proxyURL); err == nil {
|
||||
return "http://127.0.0.1:" + proxyURL
|
||||
}
|
||||
return "http://" + proxyURL
|
||||
}
|
||||
|
||||
// InitHTTPClient 创建HTTP客户端
|
||||
func InitHTTPClient(ThreadsNum int, DownProxy string, Timeout time.Duration, maxRedirects int, networkConfig *common.NetworkConfig) error {
|
||||
// 配置基础连接参数
|
||||
|
||||
Reference in New Issue
Block a user