示例#1
0
文件: app.py 项目: betterenvi/ss-link
def select():
	try:
		sel = int(request.args.get('sel')) - 1
		run_sslocal(sel)
		return 'ok'
	except Exception, e:
		return str(e)
示例#2
0
文件: app.py 项目: betterenvi/ss-link
from flask import render_template, send_file, make_response, redirect
DEBUG = False
static_dir = 'static/'

app = Flask(__name__)
app.config.from_object(__name__)
app.config.from_envvar('FLASKR_SETTINGS', silent=True)
my_port = 3100
if len(sys.argv) > 1:
	try:
		my_port = int(sys.argv[1])
	except Exception, e:
		my_port = 3100

frees = update()
run_sslocal(min(4, len(frees)))

@app.route('/')
def index():
	frees = update()
	return render_template('index.html', frees=frees)

@app.route('/sel')
def select():
	try:
		sel = int(request.args.get('sel')) - 1
		run_sslocal(sel)
		return 'ok'
	except Exception, e:
		return str(e)