Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
lcc-akm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangmingming
lcc-akm
Commits
782d5483
Commit
782d5483
authored
Mar 23, 2023
by
王明明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更换goquery
parent
97687494
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
readme.md
readme.md
+1
-1
akm_init.go
src/model/akm_init.go
+10
-7
test.go
src/test/test.go
+1
-1
No files found.
readme.md
View file @
782d5483
```shell
docker run -itd --name lcc-akm-api
2 -e logname=akm2.log --privileged=true --restart=always -v /home/opt/lcc-akm/src:/root/src/ -p 59002
:59001 --cpus=1 -m 1G --log-driver=json-file --log-opt max-size=50m --log-opt max-file=3 golang/goenv:2.0 /bin/sh "/root/src/run.sh"
docker run -itd --name lcc-akm-api
1 -e logname=akm1.log --privileged=true --restart=always -v /home/opt/lcc-akm/src:/root/src/ -p 59001
:59001 --cpus=1 -m 1G --log-driver=json-file --log-opt max-size=50m --log-opt max-file=3 golang/goenv:2.0 /bin/sh "/root/src/run.sh"
```
\ No newline at end of file
src/model/akm_init.go
View file @
782d5483
...
...
@@ -162,16 +162,19 @@ func (akm *AkmClient) getSensorBm(times int) string {
abck
,
bm_sz
:=
akm
.
GetCookie
()
t1
:=
time
.
Now
()
datas
:=
fmt
.
Sprintf
(
"times=%d&abck=%s&bm_sz=%s&url=%s"
,
times
,
abck
,
bm_sz
,
akm
.
postUrl
)
r
,
_
:=
http
.
Post
(
"http://127.0.0.1:3033/akm2t"
,
"application/x-www-form-urlencoded"
,
strings
.
NewReader
(
datas
))
rs
,
_
:=
io
.
ReadAll
(
r
.
Body
)
rsss
:=
strings
.
Split
(
string
(
rs
),
"|||||"
)
sensorData
:=
rsss
[
0
]
t2
:=
time
.
Now
()
//datas := fmt.Sprintf("times=%d&abck=%s&bm_sz=%s&url=%s", times, abck, bm_sz, akm.postUrl)
//r, _ := http.Post("http://127.0.0.1:3033/akm2t", "application/x-www-form-urlencoded", strings.NewReader(datas))
//rs, _ := io.ReadAll(r.Body)
//rsss := strings.Split(string(rs), "|||||")
//sensorData := rsss[0]
sensorData
,
_
:=
sensor
.
GenData
(
times
,
abck
,
bm_sz
,
akm
.
postUrl
)
bmRes
:=
""
abckList
:=
strings
.
Split
(
abck
,
"~"
)
bmRes
=
fmt
.
Sprintf
(
"a=%s&&&e=%s&&&sensor_data=%s"
,
abckList
[
0
],
base64
.
StdEncoding
.
EncodeToString
([]
byte
(
bmRes
)),
base64
.
StdEncoding
.
EncodeToString
([]
byte
(
sensorData
)))
bmRes
=
fmt
.
Sprintf
(
"a=%s&&&e=%s&&&sensor_data=%s"
,
abckList
[
0
],
base64
.
StdEncoding
.
EncodeToString
([]
byte
(
bm_sz
)),
base64
.
StdEncoding
.
EncodeToString
([]
byte
(
sensorData
)))
t2
:=
time
.
Now
()
akm
.
logger
.
Info
(
"第"
,
times
,
"生成一次 bm 耗时 "
,
t2
.
Sub
(
t1
)
.
String
())
return
bmRes
}
...
...
src/test/test.go
View file @
782d5483
...
...
@@ -132,7 +132,7 @@ func actVY() {
t1
:=
time
.
Now
()
//resp, err := http.Post("http://lcc.unififi.com/akamai/gen",
resp
,
err
:=
http
.
Post
(
akmUrl
,
"application/json"
,
strings
.
NewReader
(
"{
\"
type
\"
:
\"
VY
\"
,
\"
proxy
\"
:
\"
"
+
px
+
"
\"
}"
))
"application/json"
,
strings
.
NewReader
(
"{
\"
type
\"
:
\"
EW
\"
,
\"
proxy
\"
:
\"
"
+
px
+
"
\"
}"
))
//"application/json", strings.NewReader("{\"type\": \"VY\", \"proxy\": \"http://127.0.0.1:8890\"}"))
//resp, err := http.Post("http://127.0.0.1:59001/akamai/gen", "application/json", strings.NewReader("{\"type\": \"u2\", \"proxy\": \"http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600\"}"))
if
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment