RPC调用
JsRPC




Ref
Last updated




Last updated
var demo = new Hlclient("ws://127.0.0.1:12080/ws?group=api&name=test");import requests
jscode = """
(function(){
console.log("test")
return "执行成功"
})()
"""
url = "http://localhost:12080/execjs"
data = {
"group": "api",
"name": "test",
"jscode": jscode
}
res = requests.post(url, data=data)
print(res.text)var demo = new Hlclient("ws://127.0.0.1:12080/ws?group=api&name=h5Fingerprint");
window.getH5fingerprint = utility.getH5fingerprint
demo.regAction("hell0", function (resolve, url_param) {
res=window.getH5fingerprint(window.location.origin + url_param)
resolve(res);
})import requests
param2 = 'xxx'
url = "http://localhost:12080/go"
data = {
"group": "api",
"name": "h5Fingerprint",
"action": "hell0",
"url_param": param2
}
res = requests.post(url, data=data)
print(res.text)