
Security News
Bun 1.2.19 Adds Isolated Installs for Better Monorepo Support
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
A better API for asynchronous UDP
A websockets-like API for UDP
Here's an example echo server:
import asyncio
import signal
import aioudp
async def main():
async def handler(connection):
async for message in connection:
await connection.send(message)
loop = asyncio.get_running_loop()
stop = loop.create_future()
# Optional. This is for properly exiting the server when Ctrl-C is pressed
# or when the process is killed/terminated
loop.add_signal_handler(signal.SIGTERM, stop.set_result, None)
loop.add_signal_handler(signal.SIGINT, stop.set_result, None)
# Serve the server
async with aioudp.serve("localhost", 9999, handler):
await stop # Serve forever
if __name__ == '__main__':
asyncio.run(main())
And a client to connect to the server:
import asyncio
import aioudp
async def main():
async with aioudp.connect("localhost", 9999) as connection:
await connection.send(b"Hello world!")
assert await connection.recv() == b"Hello world!"
if __name__ == '__main__':
asyncio.run(main())
You can get this project via pip
$ pip install aioudp
Or, if you're using Poetry
$ poetry add aioudp
[!NOTE] This library provides no other abstractions over the existing UDP interface in
asyncio
other than theasync
/await
-based API. This means there is no implicit protocol handled in this library such as QUIC. You must write your own, or find another library.
async
IO implementation. It has a similar API (which I didn't know about before I wrote this library)Copyright © 2021, Bryan Hu
This project is licensed under the GNU GPL v3+.
In short, this means you can do anything with it (distribute, modify, sell) but if you were to publish your changes, you must make the source code and build instructions readily available.
If you are a company using this project and want an exception, email me at thatxliner@gmail.com and we can discuss.
FAQs
A better API for asynchronous UDP
We found that aioudp 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
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Security News
Popular npm packages like eslint-config-prettier were compromised after a phishing attack stole a maintainer’s token, spreading malicious updates.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.