jxhczhl / jsrpc Goto Github PK
View Code? Open in Web Editor NEW远程调用(rpc)浏览器方法,免去抠代码补环境
远程调用(rpc)浏览器方法,免去抠代码补环境
巨佬,wss支撑 还有计划开发吗
在douyin网页运行
var demo = new Hlclient("ws://127.0.0.1:12080/ws?group=test2&name=test2")
报错
VM38833:16 Refused to connect to 'ws://127.0.0.1:12080/ws?group=test2&name=test2' because it violates the following Content Security Policy directive: "connect-src 'self' *.douyin.com *.snssdk.com *.pstatp.com *.bytednsdoc.com api.feelgood.cn *.bytedance.com *.douyinvod.com *.bytescm.com *.douyincdn.com *.huoshanstatic.com".
api那边提示
注入了ws?没有找到当前组和名字
VM105810:1 WebSocket connection to 'ws://127.0.0.1:12080/ws?group=zzz' failed: 报错
Uncaught ReferenceError: blob is not defined
at WebSocket.socket.ySocket.onmessage (:37:38)
对应代码如下 _this.handlerRequest(blob)
Hlclient.prototype.connect = function () {
console.log('begin of connect to wsURL: ' + this.wsURL);
var _this = this;
try {
this.socket["ySocket"] = new WebSocket(this.wsURL);
this.socket["ySocket"].onmessage = function (e) {
try {
let blob = e.data
blob.text().then(data => {
_this.handlerRequest(data);
})
} catch {
console.log("not blob")
_this.handlerRequest(blob)
}
}
有的函数的调用必须要在打断点的情况下才能使用,不打断点的时候调用函数会提示undefined,但是打了断电js_rpc就好像不灵了,请求接口一直不返回数据,请问这种情况该如何处理呢?
{'data': '[object Object]', 'group': 'test', 'name': 'leigege', 'status': 200}
chrome
error: EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'wasm-unsafe-eval' 'inline-speculation-rules' http://localhost:* http://127.0.0.1:*".
write tcp 192.168.2.87:12080->192.168.2.87:57343: wsasend: An established connection was aborted by the software in your host machine.
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/render/json.go:56 (0x5633be)
JSON.Render: panic(err)
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:913 (0x565837)
(*Context).Render: if err := r.Render(c.Writer); err != nil {
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:956 (0x57b8e5)
(*Context).JSON: c.Render(code, render.JSON{Data: obj})
E:/JsRpc-main/main.go:151 (0x57b6cf)
ResultSet: c.JSON(200, gin.H{"status": "200", "group": client.clientGroup, "name": client.clientName, "data": <-c2})
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x56a001)
(*Context).Next: c.handlersc.index
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:99 (0x569fec)
CustomRecoveryWithWriter.func1: c.Next()
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x569146)
(*Context).Next: c.handlersc.index
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:241 (0x569129)
LoggerWithConfig.func1: c.Next()
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x56823d)
(*Context).Next: c.handlersc.index
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:489 (0x567ec5)
(*Engine).handleHTTPRequest: c.Next()
C:/Users/Administrator/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:445 (0x567b84)
(*Engine).ServeHTTP: engine.handleHTTPRequest(c)
C:/Program Files/Go/src/net/http/server.go:2947 (0x48246b)
serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
C:/Program Files/Go/src/net/http/server.go:1991 (0x47eb46)
(*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
C:/Program Files/Go/src/runtime/asm_amd64.s:1594 (0x2a5fc0)
goexit: BYTE $0x90 // NOP
如题
/page/cookie 接口怎么获取httpOnly为true的cookie呢
INFO[2024-06-21 08:46:49] 当前监听地址: ssl启用状态:false
ERRO[2024-06-21 08:46:49] 服务启动失败..
if (o(t)) {
for (var e = t.length, r = [], n = 0; n < e; n++) {
var c = t[n];
"string" == typeof c ? s(r, c) : "number" != typeof c && "Number" !== a(c) && "String" !== a(c) || s(r, u(c))
}
var l =
如何获取异步方法返回值,用await和then都不行
希望加一个心跳检测 保持连接活跃
大佬你好,如果网页上生成的加密数据是在某个函数里面,并且有一些参数是在这个函数栈里面才有的。我想在断点的时候,注入websocket的脚本,但是我发现只要页面存在断点,那js引擎线程都会被阻塞住,我的脚本里面的事件(onopen)都无法执行。如果我放开断点,那又没法使用函数栈里面的参数了。如何保留函数的上下文,又能让注入顺利运行呢?求教
这个场景就是这种情况,登录里面有一个公钥,是动态生成的,我想就断在这个函数里面,注入websocket,但是没法正常响应事件。
<button type="submit" class="btn btn-primary block full-width m-b" onclick="doLogin();return false;">登录</button>
<script>
function encryptLoginPassword(password, rsaPublicKey){
var jsencrypt = new JSEncrypt(); //加密对象
jsencrypt.setPublicKey(rsaPublicKey); // 设置密钥
return jsencrypt.encrypt(password); //加密
}
function doLogin() {
//公钥加密
var rsaPublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNAD"
var password =$('#password').val(); //明文密码
var passwordEncrypted = encryptLoginPassword(password, rsaPublicKey)
$('#password').val(passwordEncrypted); //返回给密码输入input
$('#form').submit();//post提交
}
</script>
比如返回数组;似乎得到的总是字符串
为了方便,我将JsEnv_Dev.js通过油猴hook,并且在后面添加了
window.demo = new Hlclient("ws://127.0.0.1:12080/ws?group=hello&name=search");
然后打开本地带有script的html文件
并且script中添加了远程调用3
demo.regAction("hello3", function (resolve,param) {
//这里还是param参数 param里面的key 是先这里写,但到时候传接口就必须对应的上
res=hlg(param["user"],param["status"])
resolve(res);
})
但是console区域出现了报错,远程调用3失败了
Uncaught ReferenceError: demo is not defined
我试了将window.demo改成demo也不行
请问大佬window.demo = new Hlclient("ws://127.0.0.1:12080/ws?group=hello&name=search");
这个是不能hook吗,或者有什么办法可以解决这个问题
如标题所示 我本地开了server 经常性看到server端有js端的返回值 但是请求却没有响应
打扰一下,发现win的微信小程序浏览器调试页面里没有websocket对象,请教作者有过在微信小程序里建立jsrpc吗,有没有什么思路。。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.