1 Unstar Star 0 Fork 32

cntoby / opensshPythonApache-2.0

forked from Jack / openssh 
Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
本程序使用tornado 编写的ssh代理程序,可以将ssh转化成websocket协议,可以集成到你想要的系统中 spread retract

Clone or download
main.py 1.14 KB
Copy Edit Web IDE Raw Blame History
Jack authored 2017-02-03 16:03 . 增加异步代码
__author__ = 'JackSong'
import sys
import os.path
import tornado.ioloop
import tornado.web
import tornado.httpserver
import tornado.options
import logging
import logging.handlers
from tornado.options import options
from config import init_config
from urls import handlers
from ioloop import IOloop
reload(sys)
sys.setdefaultencoding('utf-8')
settings = dict(
template_path=os.path.join(os.path.dirname(__file__), "templates"),
static_path=os.path.join(os.path.dirname(__file__), "static"),
)
class Application(tornado.web.Application):
def __init__(self):
tornado.web.Application.__init__(self, handlers, **settings)
def main():
init_config()
options.parse_config_file("openssh.conf")
options.parse_command_line()
http_server = tornado.httpserver.HTTPServer(Application())
http_server.listen(options.port)
IOloop.instance()
logger = logging.getLogger()
timelog = logging.handlers.TimedRotatingFileHandler(options.log_file_prefix)
logger.addHandler(timelog)
print('Server Starting port on %s' % (options.port,))
tornado.ioloop.IOLoop.instance().start()
if __name__ == "__main__":
main()

Comment ( 0 )

Sign in for post a comment

Python
1
https://gitee.com/cntoby/openssh.git
git@gitee.com:cntoby/openssh.git
cntoby
openssh
openssh
master

Search

131423 f1aaba0b 1899542 094922 1c74bed3 1899542