#🔒 error websocket 404

11 messages · Page 1 of 1 (latest)

upper bayBOT
#

@uncut mist

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

uncut mist
#

I will send the explanation

#

https://paste.pythondiscord.com/SSMQ

I'm trying to make a websocket connection with this link "wss://chat.modd.io/socket.io/?EIO=4&transport=websocket" but every time I try I get an error, I've been trying to do this for 3 days, this is a link to a game "https://www.modd.io/play/braainsio/" I found it by looking at the site, I gave f12, I went to network and found this link, and when I made a connection using an extension it connected and I started to receive chat messages, but when I try to pass it to Python I get this error:

#
import websocket


websocket_url = "wss://chat.modd.io/socket.io/?EIO=4&transport=websocket"

def on_message(ws, message):
    print(f"Recebido: {message}")

def on_error(ws, error):
    print(f"Erro: {error}")

def on_close(ws):
    print("Conexão fechada")

def on_open(ws):
    print("Conexão aberta")


if __name__ == "__main__":
  
    websocket.enableTrace(True)
    ws = websocket.WebSocketApp(websocket_url,
                                on_message=on_message,
                                on_error=on_error,
                                on_close=on_close)
    ws.on_open = on_open


    ws.run_forever()
stray latch
#

the on_close() function takes 3 arguments

#

you defined it with only 1

#

1st is the WebSocket 2nd is the status code and the 3rd is the message.

def on_close(ws, close_status_code, close_msg):
uncut mist
#

one of the errors stopped, but it still doesn't connect to the link

upper bayBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.