Как мне установить рукопожатие с помощью веб-сокета в Python?Python

Программы на Python
Anonymous
Как мне установить рукопожатие с помощью веб-сокета в Python?

Сообщение Anonymous »

Я хочу выполнить рукопожатие с помощью этого веб-сокета

Код: Выделить всё

wss://ws.qxbroker.com/socket.io/?EIO=3&transport=websocket
Насколько я понимаю, мне нужно сбросить эти данные для аутентификации

Код: Выделить всё

42["authorization",{"session":"oZA1xa5d4DYvNJoxxxxxxO","isDemo":1}]
что бы я ни пытался, мое соединение закрывается
вот мой код

Код: Выделить всё

from websocket import create_connection
import json

# Launch the connection to the server.
ws = create_connection('wss://ws.qxbroker.com/socket.io/?EIO=3&transport=websocket')

# Perform the handshake.
ws.send(json.dumps('42["authorization",{"session":"oZA1xa5d4DYvNJoe4kZhL911QxxxxxxxxxxsPCSTMO","isDemo":1}]'))

# Printing all the result
while True:
try:
result = ws.recv()
print(result)
except Exception as e:
print(e)
break
сайт веб-сайта: https://qxbroker.com

Подробнее здесь: https://stackoverflow.com/questions/699 ... -in-python

Вернуться в «Python»