All Projects → aaugustin → Websockets

aaugustin / Websockets

Licence: bsd-3-clause
Library for building WebSocket servers and clients in Python

Programming Languages

python
139335 projects - #7 most used programming language
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
c
50402 projects - #5 most used programming language
CSS
56736 projects
Makefile
30231 projects

Projects that are alternatives of or similar to Websockets

Arduinowebsockets
arduinoWebSockets
Stars: ✭ 1,265 (-66.03%)
Mutual labels:  websocket, websockets, websocket-server, websocket-client
Beast
HTTP and WebSocket built on Boost.Asio in C++11
Stars: ✭ 3,241 (-12.97%)
Mutual labels:  websocket, websockets, websocket-server, websocket-client
Awesome Websockets
A curated list of Websocket libraries and resources.
Stars: ✭ 850 (-77.18%)
Mutual labels:  websocket, websockets, websocket-server, websocket-client
Php Wss
Web-socket server/client with multi-process and parse templates support on server and send/receive options on client
Stars: ✭ 117 (-96.86%)
Mutual labels:  websocket, websockets, websocket-server, websocket-client
Claws
Awesome WebSocket CLient - an interactive command line client for testing websocket servers
Stars: ✭ 187 (-94.98%)
Mutual labels:  websocket, websockets, websocket-client
text
An experiment with WebSockets and the human condition.
Stars: ✭ 51 (-98.63%)
Mutual labels:  websocket-server, websockets, websocket-client
simple-websocket-server
A simple WebSocket server
Stars: ✭ 26 (-99.3%)
Mutual labels:  websocket-server, websockets, websocket-library
reactive-streams-for-java-developers
No description or website provided.
Stars: ✭ 16 (-99.57%)
Mutual labels:  websocket-server, websockets, websocket-client
Websocket
WSServer is a fast, configurable, and extendable WebSocket Server for UNIX systems written in C (C11).
Stars: ✭ 144 (-96.13%)
Mutual labels:  websocket, websockets, websocket-server
Websocket Client
WebSocket client for Python
Stars: ✭ 2,810 (-24.54%)
Mutual labels:  websocket, websockets, websocket-client
LazWebsockets
Websocket Server and Client Library written in Lazarus
Stars: ✭ 51 (-98.63%)
Mutual labels:  websocket-server, websockets, websocket-client
Ws Tcp Relay
A simple relay between WebSocket clients and TCP servers
Stars: ✭ 186 (-95.01%)
Mutual labels:  websocket, websockets, websocket-server
Libhv
🔥 比libevent、libuv更易用的国产网络库。A c/c++ network library for developing TCP/UDP/SSL/HTTP/WebSocket client/server.
Stars: ✭ 3,355 (-9.91%)
Mutual labels:  websocket, websocket-server, websocket-client
Bolt Python
A framework to build Slack apps using Python
Stars: ✭ 190 (-94.9%)
Mutual labels:  websocket, websockets, websocket-client
Embedded Jetty Websocket Examples
Embedded Jetty WebSocket Examples
Stars: ✭ 159 (-95.73%)
Mutual labels:  websocket, websocket-server, websocket-client
Rockets
REST and websockets C++ library
Stars: ✭ 39 (-98.95%)
Mutual labels:  websocket-server, websocket-client, websocket-library
Node Slack Sdk
Slack Developer Kit for Node.js
Stars: ✭ 2,988 (-19.76%)
Mutual labels:  websocket, websockets, websocket-client
Python Slack Sdk
Slack Developer Kit for Python
Stars: ✭ 3,307 (-11.2%)
Mutual labels:  websocket, websockets, websocket-client
Microwebsrv2
The last Micro Web Server for IoTs (MicroPython) or large servers (CPython), that supports WebSockets, routes, template engine and with really optimized architecture (mem allocations, async I/Os). Ready for ESP32, STM32 on Pyboard, Pycom's chipsets (WiPy, LoPy, ...). Robust, efficient and documented!
Stars: ✭ 295 (-92.08%)
Mutual labels:  websocket, websockets, websocket-server
Bolt Js
A framework to build Slack apps using JavaScript
Stars: ✭ 1,971 (-47.07%)
Mutual labels:  websocket, websockets, websocket-client

websockets

licence version pyversions wheel tests docs

What is websockets?

websockets is a library for building WebSocket servers and clients in Python with a focus on correctness, simplicity, robustness, and performance.

Built on top of asyncio, Python's standard asynchronous I/O framework, it provides an elegant coroutine-based API.

Documentation is available on Read the Docs.

Here's how a client sends and receives messages:

#!/usr/bin/env python

import asyncio
from websockets import connect

async def hello(uri):
    async with connect(uri) as websocket:
        await websocket.send("Hello world!")
        await websocket.recv()

asyncio.run(hello("ws://localhost:8765"))

And here's an echo server:

#!/usr/bin/env python

import asyncio
from websockets import serve

async def echo(websocket):
    async for message in websocket:
        await websocket.send(message)

async def main():
    async with serve(echo, "localhost", 8765):
        await asyncio.Future()  # run forever

asyncio.run(main())

Does that look good?

Get started with the tutorial!


websockets for enterprise

Available as part of the Tidelift Subscription

The maintainers of websockets and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.


(If you contribute to websockets and would like to become an official support provider, let me know.)

Why should I use websockets?

The development of websockets is shaped by four principles:

  1. Correctness: websockets is heavily tested for compliance with RFC 6455. Continuous integration fails under 100% branch coverage.
  2. Simplicity: all you need to understand is msg = await ws.recv() and await ws.send(msg). websockets takes care of managing connections so you can focus on your application.
  3. Robustness: websockets is built for production. For example, it was the only library to handle backpressure correctly before the issue became widely known in the Python community.
  4. Performance: memory usage is optimized and configurable. A C extension accelerates expensive operations. It's pre-compiled for Linux, macOS and Windows and packaged in the wheel format for each system and Python version.

Documentation is a first class concern in the project. Head over to Read the Docs and see for yourself.

Why shouldn't I use websockets?

  • If you prefer callbacks over coroutines: websockets was created to provide the best coroutine-based API to manage WebSocket connections in Python. Pick another library for a callback-based API.

  • If you're looking for a mixed HTTP / WebSocket library: websockets aims at being an excellent implementation of RFC 6455: The WebSocket Protocol and RFC 7692: Compression Extensions for WebSocket. Its support for HTTP is minimal — just enough for a HTTP health check.

    If you want do to both in the same server, look at HTTP frameworks that build on top of websockets to support WebSocket connections, like Sanic.

What else?

Bug reports, patches and suggestions are welcome!

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

For anything else, please open an issue or send a pull request.

Participants must uphold the Contributor Covenant code of conduct.

websockets is released under the BSD license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].