# 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)
```
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)
```
Metadata
Release files for Flask-WebSocket 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| Flask_WebSocket-0.1-py2.7.egg | Legacy Egg format | - | - | Details |
Release files / Flask_WebSocket-0.1-py2.7.egg
| Download URL | Flask_WebSocket-0.1-py2.7.egg |
|---|---|
| Size | 3.7 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
8433e5384931565dca8bf812782237243291adcdc6244bd992a8876d2ce668c2
|
|
BLAKE2b-256 checksum How to use checksums |
f53e3a81658b0884c92e3e1cb8f8c7bfc5c2928f877b47b4b5534ecf2485d873
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |