Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Apr 29, 2022. It is now read-only.

Commit e9de10d

Browse filesBrowse files
author
Kenneth Reitz
committed
readme example
1 parent 5f2afb4 commit e9de10d
Copy full SHA for e9de10d

File tree

1 file changed

+23
-0
lines changed
Filter options

1 file changed

+23
-0
lines changed

‎README.rst

Copy file name to clipboard
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Flask-WebSocket
2+
===============
3+
4+
WebSockets in Python are really hard.
5+
6+
::
7+
8+
from flask import Flask
9+
from flask_websockets import WebSocket
10+
11+
app = Flask(__name__)
12+
13+
@websocket.route('/echo')
14+
def echo_socket(ws):
15+
while True:
16+
message = ws.receive()
17+
ws.send(message)
18+
19+
@app.route('/'')
20+
def hello():
21+
return 'Hello World!'
22+
23+
Now they're not.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.