mirror of
https://github.com/luzhisheng/js_reverse.git
synced 2025-04-20 01:34:55 +08:00
调试websocket.md
This commit is contained in:
parent
6103a77880
commit
d460180374
0
facebook私信/main.py
Normal file
0
facebook私信/main.py
Normal file
19
facebook私信/readme1.md
Normal file
19
facebook私信/readme1.md
Normal file
@ -0,0 +1,19 @@
|
||||
fb测试地址
|
||||
|
||||
https://www.facebook.com/profile.php?id=100055837744229
|
||||
|
||||

|
||||
|
||||
打开f12,刷新页面,发现fb存在 `pending` 连接。
|
||||
|
||||
以下是 WebSocket 对象的相关事件。
|
||||
|
||||
open Socket.onopen 连接建立时触发
|
||||
message Socket.onmessage 客户端接收服务端数据时触发
|
||||
error Socket.onerror 通信发生错误时触发
|
||||
close Socket.onclose 连接关闭时触发
|
||||
Socket.send() 使用连接发送数据
|
||||
Socket.close() 关闭连接
|
||||
|
||||
先对 `Socket.send()` 打断点,但是发现存在很多位置,那如果快速找到 `Socket.send()` 发送的位置,`hook` `send()` 方法,直接快速
|
||||
|
11
facebook私信/私信.py
Normal file
11
facebook私信/私信.py
Normal file
@ -0,0 +1,11 @@
|
||||
import asyncio
|
||||
import websockets
|
||||
|
||||
|
||||
async def echo(websocket, path):
|
||||
async for message in websocket:
|
||||
message = "我收到了你的消息: {}".format(message)
|
||||
await websocket.send(message)
|
||||
|
||||
asyncio.get_event_loop().run_until_complete(websockets.serve(echo, 'localhost', 8765))
|
||||
asyncio.get_event_loop().run_forever()
|
BIN
img/107.png
Normal file
BIN
img/107.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
Loading…
x
Reference in New Issue
Block a user