mirror of
https://github.com/Flowseal/tg-ws-proxy.git
synced 2026-06-18 12:38:27 +03:00
This commit is contained in:
committed by
GitHub
parent
13d2b1db6d
commit
96e5b4b639
@@ -154,6 +154,13 @@ class RawWebSocket:
|
||||
self._build_frame(self.OP_BINARY, part, mask=True))
|
||||
await self.writer.drain()
|
||||
|
||||
async def send_ping(self, payload: bytes = b''):
|
||||
if self._closed:
|
||||
raise ConnectionError("WebSocket closed")
|
||||
frame = self._build_frame(self.OP_PING, payload, mask=True)
|
||||
self.writer.write(frame)
|
||||
await self.writer.drain()
|
||||
|
||||
async def recv(self) -> Optional[bytes]:
|
||||
while not self._closed:
|
||||
opcode, payload = await self._read_frame()
|
||||
|
||||
Reference in New Issue
Block a user