mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2025-06-29 06:15:12 +00:00
Implement and integrate TerminadoEvendHandler to docker container
This commit is contained in:
24
src/event_handlers/terminado_server/server.py
Normal file
24
src/event_handlers/terminado_server/server.py
Normal file
@ -0,0 +1,24 @@
|
||||
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()
|
Reference in New Issue
Block a user