Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
coco
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
coco
Commits
bbf38e4c
Commit
bbf38e4c
authored
Oct 21, 2017
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change something
parent
05c0e693
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
11 deletions
+6
-11
app.py
coco/app.py
+1
-0
forward.py
coco/forward.py
+1
-1
interactive.py
coco/interactive.py
+0
-2
models.py
coco/models.py
+4
-8
No files found.
coco/app.py
View file @
bbf38e4c
...
...
@@ -50,6 +50,7 @@ class Coco:
self
.
make_logger
()
self
.
sshd
=
None
self
.
running
=
True
def
make_logger
(
self
):
create_logger
(
self
)
...
...
coco/forward.py
View file @
bbf38e4c
...
...
@@ -40,7 +40,7 @@ class ProxyServer:
try
:
ssh
.
connect
(
asset
.
ip
,
port
=
asset
.
port
,
username
=
system_user
.
username
,
password
=
system_user
.
password
,
pkey
=
system_user
.
private_key
)
except
(
paramiko
.
AuthenticationException
,)
as
e
:
except
(
paramiko
.
AuthenticationException
,
paramiko
.
ssh_exception
.
NoValidConnectionsError
)
as
e
:
pass
except
socket
.
error
:
...
...
coco/interactive.py
View file @
bbf38e4c
#!coding: utf-8
import
socket
import
select
from
.
import
char
from
.utils
import
TtyIOParser
,
wrap_with_line_feed
as
wr
,
\
wrap_with_primary
as
primary
,
wrap_with_warning
as
warning
...
...
coco/models.py
View file @
bbf38e4c
import
json
import
threading
import
select
BUF_SIZE
=
4096
...
...
@@ -160,12 +158,10 @@ class WSProxy:
def
forward
(
self
):
while
not
self
.
stop_event
.
is_set
():
r
,
w
,
e
=
select
.
select
([
self
.
child
],
[],
[])
if
self
.
child
in
r
:
data
=
self
.
child
.
recv
(
BUF_SIZE
)
if
len
(
data
)
==
0
:
self
.
close
()
self
.
ws
.
write_message
(
data
)
data
=
self
.
child
.
recv
(
BUF_SIZE
)
if
len
(
data
)
==
0
:
self
.
close
()
self
.
ws
.
write_message
(
data
)
def
auto_forward
(
self
):
thread
=
threading
.
Thread
(
target
=
self
.
forward
,
args
=
())
...
...
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