mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-14 04:07:17 +00:00
24 lines
674 B
Python
24 lines
674 B
Python
|
import logging
|
||
|
from tornado.ioloop import IOLoop
|
||
|
from tornado.web import Application
|
||
|
from terminado import TermSocket, SingleTermManager
|
||
|
|
||
|
from config import TERMINADO_PORT
|
||
|
|
||
|
|
||
|
class CORSTermSocket(TermSocket):
|
||
|
def check_origin(self, origin):
|
||
|
return True
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
application = Application(
|
||
|
[(
|
||
|
r'/terminal',
|
||
|
CORSTermSocket,
|
||
|
{'term_manager': SingleTermManager(shell_command=['bash'])}
|
||
|
)]
|
||
|
)
|
||
|
application.listen(TERMINADO_PORT)
|
||
|
logging.getLogger().setLevel(logging.DEBUG)
|
||
|
logging.info('Terminado Mini Server listening on {}'.format(TERMINADO_PORT))
|
||
|
IOLoop.instance().start()
|