Unverified Commit 31a4a167 authored by 老广's avatar 老广 Committed by GitHub

Merge pull request #42 from jumpserver/dev

Dev
parents b9df19f4 458b7cd8
......@@ -3,6 +3,10 @@
koko是golang版本的的coco;重构了coco的SSH/SFTP服务和web terminal服务。
## 注意
Koko的 web socket库不再使用socket.io,因为go里没有稳定的,替换成了[neffos](https://github.com/kataras/neffos),
所以luna不再和原来兼容,请下载luna的koko版本
## 主要功能
......
<html>
<body style="margin: 0">
<script type="text/javascript" src="/static/js/jquery-2.1.1.js"></script>
<script type="text/javascript" src="/static/js/jquery-ui-1.10.4.min.js"></script>
<script type="text/javascript" src="/static/js/neffos.min.js"></script>
<script type="text/javascript" src="/static/plugins/elfinder/elfinder.full.js"></script>
<script type="text/javascript" src="/static/plugins/elfinder/i18n/elfinder.pl.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="/static/plugins/elfinder/css/elfinder.min.css">
<link rel="stylesheet" type="text/css" media="screen" href="/static/plugins/elfinder/css/theme-gray.css">
<script type="text/javascript" src="/coco/static/js/jquery-2.1.1.js"></script>
<script type="text/javascript" src="/coco/static/js/jquery-ui-1.10.4.min.js"></script>
<script type="text/javascript" src="/coco/static/js/neffos.min.js"></script>
<script type="text/javascript" src="/coco/static/plugins/elfinder/elfinder.full.js"></script>
<script type="text/javascript" src="/coco/static/plugins/elfinder/i18n/elfinder.pl.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="/coco/static/plugins/elfinder/css/elfinder.min.css">
<link rel="stylesheet" type="text/css" media="screen" href="/coco/static/plugins/elfinder/css/theme-gray.css">
<script type="text/javascript" charset="utf-8">
var scheme = document.location.protocol == "https:" ? "wss" : "ws";
var port = document.location.port ? ":" + document.location.port : "";
......
......@@ -19,7 +19,7 @@ var (
var wsEvents = neffos.Namespaces{
"ssh": neffos.Events{
neffos.OnNamespaceConnected: OnNamespaceConnected,
neffos.OnNamespaceConnected: OnNamespaceConnected,
neffos.OnNamespaceDisconnect: OnNamespaceDisconnect,
neffos.OnRoomJoined: func(c *neffos.NSConn, msg neffos.Message) error {
return nil
......@@ -28,14 +28,14 @@ var wsEvents = neffos.Namespaces{
return nil
},
"data": OnDataHandler,
"data": OnDataHandler,
"resize": OnResizeHandler,
"host": OnHostHandler,
"host": OnHostHandler,
"logout": OnLogoutHandler,
"token": OnTokenHandler,
"token": OnTokenHandler,
},
"elfinder": neffos.Events{
neffos.OnNamespaceConnected: OnELFinderConnect,
neffos.OnNamespaceConnected: OnELFinderConnect,
neffos.OnNamespaceDisconnect: OnELFinderDisconnect,
},
}
......@@ -51,7 +51,7 @@ func StartHTTPServer() {
router := mux.NewRouter()
fs := http.FileServer(http.Dir(filepath.Join(conf.RootPath, "static")))
router.PathPrefix("/static/").Handler(http.StripPrefix("/static/", fs))
router.PathPrefix("/coco/static/").Handler(http.StripPrefix("/static/", fs))
router.Handle("/socket.io/", sshWs)
router.HandleFunc("/coco/elfinder/sftp/{host}/", AuthDecorator(sftpHostFinder))
......@@ -68,5 +68,3 @@ func StartHTTPServer() {
func StopHTTPServer() {
_ = httpServer.Close()
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment