Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

websocket-httpd

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

websocket-httpd

module for creating a http server which uses WebSockets

  • 0.5
  • PyPI
  • Socket score

Maintainers
1

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.

FAQs


Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc