Skip to main content
Bottle Tornado Websocket
========================

This project adds websocket capabilities to [bottle](http://bottlepy.org), leveraging [tornado](http://www.tornadoweb.org/)

### Install
Use `pip` or `easy_install`:

pip install bottle-tornado-websocket

### Requirements

* Bottle
* Tornado

### Usage
Import the server and tornado's WebSocketHandler:

from bottle_tornado_websocket import TornadoWebSocketServer
from tornado.websocket import WebSocketHandler

Create your application handlers, for example:

class EchoWebSocket(tornado.websocket.WebSocketHandler):
def open(self):
print 'Connected')

def on_message(self, message):
self.write(message)

def on_close(self):
print 'Connection closed')

Map handlers to urls:

tornado_handlers = [
(r"/echo", EchoWebSocket)
]

Note: the `.*` is automatically mapped as a last handler to your normal bottle application

And then use the provided server:

run(port=8080, server=TornadoWebSocketServer, handlers=tornado_handlers)

### Example
To echo chat example just run `chat.py` in `examples/echo` folder:

python echo.py

To run chat example just run `chat.py` in `examples/chat` folder:

python chat.py

Metadata

Release files for bottle-tornado-websocket 0.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bottle-tornado-websocket 0.13
File Size Uploaded Provenance Actions
bottle-tornado-websocket-0.13.zip 5.4 kB Without provenance Details for bottle-tornado-websocket-0.13.zip

Release files / bottle-tornado-websocket-0.13.zip

Download URL bottle-tornado-websocket-0.13.zip
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b3a0002c2a44c06af99e759b188eeada6b39877222c1bc96bd22b876b5d90daa
BLAKE2b-256 checksum
How to use checksums
a78a04cac82c02cc7031361e850f516732f78aa25727ed1245931276616af3b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for bottle-tornado-websocket 0.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.13 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page