[Python] Python websocket library, how to output websocket handshake?

Discussão em 'Python' iniciado por Stack, Agosto 26, 2025.

  1. Stack

    Stack Membro Participativo

    I am using the Python websocket library. I need to output the websocket handshake GET request.

    My code effectively looks like this:

    from websocket import create_connection

    ws = create_connection("the websocket url")


    I found:

    ws.enableTrace(True)


    but obviously I cannot put it before the connection/object is created and afterwards is too late.

    I also tried adding this before:

    import logging

    logging.basicConfig(
    format="%(asctime)s %(message)s",
    level=logging.DEBUG,
    )


    but it didn't do anything.

    Can someone please advise?

    Continue reading...

Compartilhe esta Página