Skip to main content

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

websocket-httpd-0.4.tar.gz (33.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

websocket_httpd-0.4-py3-none-any.whl (33.6 kB view details)

Uploaded Python 3

File details

Details for the file websocket-httpd-0.4.tar.gz.

File metadata

  • Download URL: websocket-httpd-0.4.tar.gz
  • Upload date:
  • Size: 33.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for websocket-httpd-0.4.tar.gz
Algorithm Hash digest
SHA256 9fe29b594c58cd3cd563e4f105bd64d7a059ad993110753cf0fd25e4ef18a8b0
MD5 a2947edd7e7722d1f7d485f1dec7b2a8
BLAKE2b-256 a5b4d1959a539161692634939c98670a60e80b14df9367344970a0f833cf16e6

See more details on using hashes here.

File details

Details for the file websocket_httpd-0.4-py3-none-any.whl.

File metadata

  • Download URL: websocket_httpd-0.4-py3-none-any.whl
  • Upload date:
  • Size: 33.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for websocket_httpd-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7fda3c38a63aa902c1d6984befbf16f8014113004f8646e19e1bbb1b5c49d4da
MD5 a83832792c45771c9c325de270a695a9
BLAKE2b-256 e649a63f2ef2113cb02ff1099fecc8efdbd715c73858beb3af6cf74a3a531fb5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page