-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Terminado with Unix sockets #192
Comments
You should take a peek at https://gist.github.com/superduper/5579037#file-tornado-unix-socket-py I think you just need to use tornado's tornado.netutil.bind_unix_socket instead of tornado.web.Application::listen |
Thanks, Chris. It seems to work on the first glance, but it would be more useful for the future reader to have it placed in |
I have tried: """A separate terminal for every websocket opened.
"""
import tornado.ioloop
import tornado.web
from tornado.httpserver import HTTPServer
from tornado.options import options, define
from tornado.netutil import bind_unix_socket
# This demo requires tornado_xstatic and XStatic-term.js
import tornado_xstatic
from common_demo_stuff import STATIC_DIR, TEMPLATE_DIR, run_and_show_browser
from terminado import TermSocket, UniqueTermManager
class TerminalPageHandler(tornado.web.RequestHandler):
def get(self):
return self.render(
"termpage.html",
static=self.static_url,
xstatic=self.application.settings["xstatic_url"],
ws_url_path="/websocket",
)
def main(argv):
term_manager = UniqueTermManager(shell_command=["bash"])
handlers = [
(r"/websocket", TermSocket, {"term_manager": term_manager}),
(r"/", TerminalPageHandler),
(r"/xstatic/(.*)", tornado_xstatic.XStaticFileHandler, {"allowed_modules": ["termjs"]}),
]
app = tornado.web.Application(
handlers,
static_path=STATIC_DIR,
template_path=TEMPLATE_DIR,
xstatic_url=tornado_xstatic.url_maker("/xstatic/"),
)
server = HTTPServer(app)
socket = bind_unix_socket("/run/terminado/root.sock")
server.add_socket(socket)
tornado.ioloop.IOLoop.instance().start()
if __name__ == "__main__":
main([]) After the service was started the Now, using Apache config under
.. and when visiting
.. however the following error is returned on the console: I have no clue right now why Also, is there a way to add/pass so called |
@KoopaKing Chris, could you please check if the Python script part in example above is correct for Terminado to work with Unix sockets? |
Hello,
Thank you for an amazing terminal emulator!
Can anyone please provide an example of how Terminado could be used with Unix socket file instead of TCP port, in familiar example as in
demos/unique.py
? Is this even possible?The text was updated successfully, but these errors were encountered: