Aymeric Augustin

Results 368 comments of Aymeric Augustin

Or, if you want to go low level, you could also use the Sans-I/O layer for testing. Docs here: https://websockets.readthedocs.io/en/stable/howto/sansio.html Essentially you'd receive a TCP connection from your hardware and...

Wait - I have a far simpler idea - instantiate directly a [ServerConnection](https://websockets.readthedocs.io/en/stable/reference/sync/server.html#websockets.sync.server.ServerConnection) - that should just work? ```python import socket import websockets.server import websockets.sync.server sock = socket.create_server((HOST, PORT)) conn,...

Upon further thought, this is too much of an edge case to document in the FAQ.

The [documentation](https://websockets.readthedocs.io/en/stable/reference/asyncio/server.html) for `request_headers` says: > The following attributes are available after the opening handshake, once the WebSocket connection is open: ... You're trying to use the attribute before it's...

This can happen in other places, notably [here](https://github.com/python-websockets/websockets/blob/33b20e11e86f8490770185c78ed39adab8db4560/src/websockets/protocol.py#L569) if the handshake request or response received from the other side isn't a valid HTTP message. One possible solution would be to...

Yes, that's the correct implementation in the current state of the library. I'm not super excited by that option, though, because it puts the burden on every user of the...

Logs have expired and I don't remember seeing this happening recently.

When you say: > whilst the heartbeat has been missed, the rest of data exchange continues unabated I assume that you mean that the data exchange from client to server...