Updated server/server.py
Updated ws_talk.py
This commit is contained in:
parent
12df5d67fc
commit
e51c18eae4
|
|
@ -23,10 +23,10 @@ async def talking(request: Request, ws: Websocket) -> HTTPResponse:
|
||||||
while True:
|
while True:
|
||||||
data = await ws.recv()
|
data = await ws.recv()
|
||||||
print(data)
|
print(data)
|
||||||
new_message = Message(
|
# new_message = Message(
|
||||||
message=request.form.get("text")
|
# message=request.form.get("text")
|
||||||
)
|
# )
|
||||||
actual_messages.append(new_message)
|
#actual_messages.append(new_message)
|
||||||
await ws.send("{'status': 'ok'}")
|
await ws.send("{'status': 'ok'}")
|
||||||
await asyncio.sleep(0.2)
|
await asyncio.sleep(0.2)
|
||||||
# return response.json({"status": "ok"})
|
# return response.json({"status": "ok"})
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ from websocket import create_connection
|
||||||
ws = create_connection("ws://localhost:1212/talk")
|
ws = create_connection("ws://localhost:1212/talk")
|
||||||
while True:
|
while True:
|
||||||
ws.send(payload=b"{'text': 123, 'username': 'bob'}")#json.dumps({"op":"addr_sub", "addr":"dogecoin_address"}))
|
ws.send(payload=b"{'text': 123, 'username': 'bob'}")#json.dumps({"op":"addr_sub", "addr":"dogecoin_address"}))
|
||||||
result = ws.recv()
|
result = ws.recv()
|
||||||
print(result)
|
print(result)
|
||||||
#print(eval(result))
|
#print(eval(result))
|
||||||
#print(result)
|
#print(result)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user