-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdebug.py
More file actions
31 lines (25 loc) · 849 Bytes
/
debug.py
File metadata and controls
31 lines (25 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
httphq.debug
~~~~~~~~~~~~
Local debug runner
:copyright: (c) 2011 - 2013 by Alexandr Lispython (alex@obout.ru).
:license: BSD, see LICENSE for more details.
"""
import tornado.ioloop
from tornado import httpserver, autoreload
from tornado.options import options, parse_command_line
from httphq.app import application, rel
if __name__ == '__main__':
parse_command_line()
http_server = httpserver.HTTPServer(application)
https_server = httpserver.HTTPServer(application, ssl_options={
"certfile": rel("..", "server.crt"),
"keyfile": rel("..", "server.key"),
})
http_server.listen(options.port)
https_server.listen(options.ssl_port)
ioloop = tornado.ioloop.IOLoop.instance()
autoreload.start(io_loop=ioloop, check_time=100)
ioloop.start()