//新调用,此退出
if boot_F_x25Kn.NeedExit(id) {return}
- var rt_obj = RT{
- R:R{
- Id:`[`+strconv.Itoa(c.ParentAreaID)+`,`+strconv.Itoa(c.AreaID)+`,`+strconv.Itoa(loop_num)+`,`+strconv.Itoa(c.Roomid)+`]`,
- Device:`["`+LIVE_BUVID+`","`+new_uuid+`"]`,
- Ets:res.Data.Timestamp,
- Benchmark:res.Data.Secret_key,
- Time:res.Data.Heartbeat_interval,
- Ts:int(p.Sys().GetMTime()),
- Ua:`Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0`,
- },
- T:res.Data.Secret_rule,
+ var (
+ rt_obj = RT{
+ R:R{
+ Id:`[`+strconv.Itoa(c.ParentAreaID)+`,`+strconv.Itoa(c.AreaID)+`,`+strconv.Itoa(loop_num)+`,`+strconv.Itoa(c.Roomid)+`]`,
+ Device:`["`+LIVE_BUVID+`","`+new_uuid+`"]`,
+ Ets:res.Data.Timestamp,
+ Benchmark:res.Data.Secret_key,
+ Time:res.Data.Heartbeat_interval,
+ Ts:int(p.Sys().GetMTime()),
+ Ua:`Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0`,
+ },
+ T:res.Data.Secret_rule,
+ }
+ wasm string
+ )
+
+
+ if rt_obj,wasm = Wasm(0, rt_obj);wasm == `` {//0全局
+ apilog.L(`E: `,`发生错误`)
+ return
}
PostStr := `id=`+rt_obj.R.Id+`&`
PostStr += `ua=`+rt_obj.R.Ua+`&`
PostStr += `csrf_token=`+csrf+`&csrf=`+csrf+`&`
PostStr += `visit_id=`
-
- if wasm := Wasm(0, rt_obj);wasm == `` {//0全局
- apilog.L(`E: `,`发生错误`)
- return
- } else {
- PostStr = `s=`+wasm+`&`+PostStr
- }
+ PostStr = `s=`+wasm+`&`+PostStr
Cookie := make(map[string]string)
c.Cookie.Range(func(k,v interface{})(bool){
wslog.L(`I: `,`使用WebJs`,webpath,`进行加密`)
}
-func Wasm(uid uintptr,s RT) (o string) {//maxloop 超时重试
+func Wasm(uid uintptr,rt RT) (so RT, o string) {//maxloop 超时重试
+ so = rt
+
{//nodejs
if nodeJsUrl != "" {
req := reqf.New()
`Content-Type`: `application/json`,
},
Url:nodeJsUrl,
- PostStr:toNodeJsString(s),
+ PostStr:toNodeJsString(so),
Proxy:c.Proxy,
Timeout:3*1000,
});err != nil {
wslog.L(`E: `,err)
- o = Wasm(uid, s)
+ so,o = Wasm(uid, so)
return
}
return
}
- if !strings.Contains(s.R.Ua, `Test`) {
- s.R.Ts = int(p.Sys().GetMTime())
+ if !strings.Contains(so.R.Ua, `Test`) {
+ so.R.Ts = int(p.Sys().GetMTime())
}
- b, e := json.Marshal(s)
+ b, e := json.Marshal(so)
if e != nil {
wslog.L(`E: `,e)
}
for {
select {
case r :=<- rec_chan:
- if r.Id != s.R.Id {break}//或许接收到之前的请求,校验Id字段
- return r.S
+ if r.Id != so.R.Id {break}//或许接收到之前的请求,校验Id字段
+ return so, r.S
case <- time.After(time.Second*time.Duration(1)):
wslog.L(`E: `,`超时!响应>1s,确认保持`,webpath,`开启`)
return
func test(uid uintptr) bool {
time.Sleep(time.Second*time.Duration(3))
- if s := Wasm(uid, RT{
+ if _,s := Wasm(uid, RT{
R:R{
Id: "[9,371,1,22613059]",
Device: "[\"AUTO8216117272375373\",\"77bee604-b591-4664-845b-b69603f8c71c\"]",