Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
K
koko
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
koko
Commits
9aa34a44
Commit
9aa34a44
authored
May 09, 2019
by
Eric
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] fix panic err
parent
778af195
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
parser.go
pkg/proxy/parser.go
+2
-0
proxy.go
pkg/proxy/proxy.go
+5
-4
switch.go
pkg/proxy/switch.go
+2
-1
No files found.
pkg/proxy/parser.go
View file @
9aa34a44
...
...
@@ -60,6 +60,8 @@ func (p *Parser) Initial() {
p
.
cmdOutputParser
=
&
CmdParser
{}
p
.
cmdInputParser
.
Initial
()
p
.
cmdOutputParser
.
Initial
()
record
:=
NewCommandRecorder
(
p
.
session
)
p
.
SetCommandRecorder
(
record
)
}
// Todo: parseMultipleInput 依然存在问题
...
...
pkg/proxy/proxy.go
View file @
9aa34a44
...
...
@@ -13,6 +13,7 @@ import (
"cocogo/pkg/logger"
"cocogo/pkg/model"
"cocogo/pkg/service"
"strconv"
)
type
ProxyServer
struct
{
...
...
@@ -46,10 +47,10 @@ func (p *ProxyServer) validatePermission() bool {
func
(
p
*
ProxyServer
)
getServerConn
()
(
srvConn
ServerConnection
,
err
error
)
{
srvConn
=
&
ServerSSHConnection
{
host
:
"192.168.244.185"
,
port
:
"22"
,
user
:
"web"
,
password
:
"redhat"
,
host
:
p
.
Asset
.
Ip
,
port
:
strconv
.
Itoa
(
p
.
Asset
.
Port
)
,
user
:
p
.
SystemUser
.
UserName
,
password
:
p
.
SystemUser
.
Password
,
timeout
:
config
.
Conf
.
SSHTimeout
,
}
pty
,
_
,
ok
:=
p
.
Session
.
Pty
()
...
...
pkg/proxy/switch.go
View file @
9aa34a44
...
...
@@ -5,7 +5,7 @@ import (
"time"
"github.com/gliderlabs/ssh"
"github.com/satori/go.uuid"
uuid
"github.com/satori/go.uuid"
"cocogo/pkg/logger"
)
...
...
@@ -14,6 +14,7 @@ func NewSwitch(userConn UserConnection, serverConn ServerConnection) (sw *Sessio
parser
:=
new
(
Parser
)
parser
.
Initial
()
sw
=
&
Session
{
userConn
:
userConn
,
serverConn
:
serverConn
,
parser
:
parser
}
parser
.
session
=
sw
return
sw
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment