Commit b515d23b authored by 王明明's avatar 王明明

更换goquery

parent 782d5483
......@@ -9,7 +9,6 @@ import (
"gopkg.in/natefinch/lumberjack.v2"
"log"
"net/http"
_ "net/http/pprof"
"path"
"test/model"
"test/util"
......@@ -20,9 +19,6 @@ func WelcomeHandler(w http.ResponseWriter, r *http.Request) {
}
func main() {
go func() {
log.Println(http.ListenAndServe("0.0.0.0:6060", nil))
}()
logname := flag.String("logname", "akm.log", "日志文件名")
flag.Parse()
......
......@@ -70,21 +70,20 @@ func (akm *AkmClient) Init() error {
for _, attr := range attrs {
if attr.Key == "src" && !strings.Contains(attr.Val, ".") {
akm.SensorUrl = fmt.Sprintf("%s://%s%s", uri.Scheme, uri.Host, attr.Val)
break
goto continute
}
}
startIdx--
lastScript = scripts[startIdx]
}
continute:
// akm.SensorUrl = fmt.Sprintf("%s://%s%s", uri.Scheme, uri.Host, matchs[1])
if akm.SensorUrl == "" {
akm.logger.Errorln("提取不到sensorUrl失败")
return errors.New("提取不到sensorUrl 失败")
}
akm.logger.Info("请求sensor url:", akm.SensorUrl)
akm.logger.Info("初始化abck 耗时", time.Since(startTime).String())
akm.logger.Info("初始化abck 耗时", time.Since(startTime).String(), " 请求sensor url:", akm.SensorUrl)
return nil
}
func NewAkmClient(initUrl, postUrl, proxyUrl string, logger *logrus.Entry) *AkmClient {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment