
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Tranquil WebSockets for Python.
Lomond is a Websocket client which turns a websocket connection in to an orderly stream of events. No threads or callbacks necessary.
To connect to a "ws:" or "wss:" WebSocket URL, construct a lomond.WebSocket
object then iterate over it. This will yield an event object for each step in the connection process and for any data sent by the server.
You will receive a Binary
or Text
event when the server sends you a message.
You may send a message with the send_binary
or send_text
methods.
The following is a silly example that connects to a websocket server (in this case a public echo server), and sends a string of text every 5 seconds.
from lomond import WebSocket
websocket = WebSocket('wss://echo.websocket.org')
for event in websocket:
if event.name == 'poll':
websocket.send_text('Hello, World')
elif event.name == 'text':
print(event.text)
A successful websocket connection will result in a series of events such as the following:
āāāāāāāāāāāāāāāāāāāāāāāā
ā Connecting ā Contacting server
āāāāāāāāāāāāāāāāāāāāāāāā
ā
ā¼
āāāāāāāāāāāāāāāāāāāāāāāā Connected to server (but
ā Connected ā not yet sent data)
āāāāāāāāāāāāāāāāāāāāāāāā
ā
ā¼
āāāāāāāāāāāāāāāāāāāāāāāā Negotiated Websocket
ā Ready ā handshake
āāāāāāāāāāāāāāāāāāāāāāāā
ā āāāāāāāāāāāāā
ā ā ā
ā¼ ā¼ ā
āāāāāāāāāāāāāāāāāāāāāāāā ā Send and receive
ā Binary / Text / Poll āāāā application data
āāāāāāāāāāāāāāāāāāāāāāāā
ā
ā¼
āāāāāāāāāāāāāāāāāāāāāāāā Websocket close
ā Closed ā handshake
āāāāāāāāāāāāāāāāāāāāāāāā
ā
ā¼
āāāāāāāāāāāāāāāāāāāāāāāā
ā Disconnected ā Disconnected TCP/IP
āāāāāāāāāāāāāāāāāāāāāāāā connection to server
FAQs
Websocket Client Library
We found that lomond demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Ā It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.