module for creating a http server which uses WebSockets
Project description
This module uses the network module to create a server, and implements http(s) and WebSockets over those connections. The most useful part of it is the RPC over WebSocket protocol. With only 6 lines of code you have a working system:
import websocketd
class Rpc:
def __init__(self, remote):
self.remote = remote
s = websocketd.RPChttpd(8000, Rpc)
websocketd.fgloop()
You only have to add what you want your server to do. Any connection to the server (in this case it listens on port 8000) causes an Rpc object to be instanced. Any calls made through that connection will cause method calls on that object. If the remote side supports the same protocol, calls can be made on it by calling methods on remote.
Please see example/server for more details on how to use this module.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file websocket-httpd-0.5.tar.gz.
File metadata
- Download URL: websocket-httpd-0.5.tar.gz
- Upload date:
- Size: 34.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3aa86ab41c0299fd1bff32660eb5ac0acfd40b6cb75a16872d5e55abdc3942d
|
|
| MD5 |
17a8e0c1bfb28f68ef9bb0857e5fc56a
|
|
| BLAKE2b-256 |
017a585d9b87f0cc6886975f5124feb401eeffefbe8a111bbbd366d956d1f084
|
File details
Details for the file websocket_httpd-0.5-py3-none-any.whl.
File metadata
- Download URL: websocket_httpd-0.5-py3-none-any.whl
- Upload date:
- Size: 34.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a550266c999047c4e1c8e3c8c149dbae51e5d0c8456b05095f7b4157acf33c4
|
|
| MD5 |
8054f8f3fc398c663a059394b0dd79a0
|
|
| BLAKE2b-256 |
c161a7f3d5b40f2ec42fd1088cc5c9f5670d72ab176d94f73c893e8d0a8c9a41
|