Installation environment for build websocket program with flask

build web socket program with flask-uwsgi-web-socket

0x01 what we need?

  1. flask
  2. flask_uwsgi_websocket
  3. python environment
  4. uwsgi

0x02 what we need do?

use docker

$ docker run -itd --name websocket -v ~/Program/code/path:/kerwin -p 8080:8080 python:3.5.4
$ docker exec -it websocket bash
root@0c22401e0a7f:/# pip install Flask-uWSGI-WebSocket
root@0c22401e0a7f:/# pip install gevent
root@0c22401e0a7f:/# cd /kerwin/exam1
root@0c22401e0a7f:/kerwin/exam1# uwsgi --master --http :8080 --http-websockets --wsgi echo:app

0x03 what we get now?

if everything is ok. now , we can see this page.


Installation environment for build websocket program with flask_第1张图片
websocket init.png

and when we send a message, we can get two message back


Installation environment for build websocket program with flask_第2张图片
websocket_exam1.png

0x04 where is the exam code?

exam code click here :)

你可能感兴趣的:(Installation environment for build websocket program with flask)