Skip to main content

simple websocket for Flask

Project description

# Flask-WebSocket


copyright: (c) 2017 by Damon Chen.
license: BSD, see LICENSE for more details.

simple websocket for Flask

## Install

pip install flask-websocket


## Usage

you must define message with the follow message if you use on decorator:

```
{
"event": event for listen
"data": the event happend with dtaa
}
```



```python

from flask import Flask
from flask_websocket import WebSocket

app = Flask(__name__)
ws = WebSocket(app)

@ws.on('click')
def click(data):
print(data)


```


or you could process raw message by yourself.


```python
from flask import Flask
from flask_websocket import WebSocket

app = Flask(__name__)
ws = WebSocket(app)


@ws.on_raw_message
def raw_message_handler(message):
print(message)


```

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

Flask_WebSocket-0.1-py2.7.egg (3.7 kB view details)

Uploaded Source

File details

Details for the file Flask_WebSocket-0.1-py2.7.egg.

File metadata

File hashes

Hashes for Flask_WebSocket-0.1-py2.7.egg
Algorithm Hash digest
SHA256 8433e5384931565dca8bf812782237243291adcdc6244bd992a8876d2ce668c2
MD5 801ddc5ae3c9d78a8db6305d669f3747
BLAKE2b-256 f53e3a81658b0884c92e3e1cb8f8c7bfc5c2928f877b47b4b5534ecf2485d873

See more details on using hashes here.

Supported by

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