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.ext.tornadosocket 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-tornadosocket 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-tornadosocket 0.13
File Size Uploaded Provenance Actions
bottle-tornadosocket-0.13.zip 5.3 kB Without provenance Details for bottle-tornadosocket-0.13.zip

Release files / bottle-tornadosocket-0.13.zip

Download URL bottle-tornadosocket-0.13.zip
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
77b5953bdcf9e6931a90538ee018da5f592a84f8b7fc6f852c441a5230a0072b
BLAKE2b-256 checksum
How to use checksums
29691cbe0cca44075b37da92e02e27f0edb77d74b612d565f92f7c35a9c5c80b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for bottle-tornadosocket 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