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
511f6c30
Commit
511f6c30
authored
Nov 30, 2017
by
liuzheng712
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style(coco/httpd.py): that is WebSocket
parent
bd3fc09f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
httpd.py
coco/httpd.py
+7
-7
No files found.
coco/httpd.py
View file @
511f6c30
...
@@ -20,7 +20,7 @@ from .interactive import InteractiveServer
...
@@ -20,7 +20,7 @@ from .interactive import InteractiveServer
logger
=
logging
.
getLogger
(
__file__
)
logger
=
logging
.
getLogger
(
__file__
)
class
BaseWe
h
SocketHandler
:
class
BaseWe
b
SocketHandler
:
def
prepare
(
self
):
def
prepare
(
self
):
self
.
app
=
self
.
settings
[
"app"
]
self
.
app
=
self
.
settings
[
"app"
]
child
,
parent
=
socket
.
socketpair
()
child
,
parent
=
socket
.
socketpair
()
...
@@ -38,7 +38,7 @@ class BaseWehSocketHandler:
...
@@ -38,7 +38,7 @@ class BaseWehSocketHandler:
return
True
return
True
class
InteractiveWe
hSocketHandler
(
BaseWeh
SocketHandler
,
tornado
.
websocket
.
WebSocketHandler
):
class
InteractiveWe
bSocketHandler
(
BaseWeb
SocketHandler
,
tornado
.
websocket
.
WebSocketHandler
):
@tornado.web.authenticated
@tornado.web.authenticated
def
open
(
self
):
def
open
(
self
):
InteractiveServer
(
self
.
app
,
self
.
client
)
.
interact_async
()
InteractiveServer
(
self
.
app
,
self
.
client
)
.
interact_async
()
...
@@ -68,19 +68,19 @@ class InteractiveWehSocketHandler(BaseWehSocketHandler, tornado.websocket.WebSoc
...
@@ -68,19 +68,19 @@ class InteractiveWehSocketHandler(BaseWehSocketHandler, tornado.websocket.WebSoc
pass
pass
class
ProxyWe
hSocketHandler
(
BaseWeh
SocketHandler
):
class
ProxyWe
bSocketHandler
(
BaseWeb
SocketHandler
):
pass
pass
class
MonitorWe
hSocketHandler
(
BaseWeh
SocketHandler
):
class
MonitorWe
bSocketHandler
(
BaseWeb
SocketHandler
):
pass
pass
class
HttpServer
:
class
HttpServer
:
routers
=
[
routers
=
[
(
r'/ws/interactive/'
,
InteractiveWe
h
SocketHandler
),
(
r'/ws/interactive/'
,
InteractiveWe
b
SocketHandler
),
(
r'/ws/proxy/(?P<asset_id>[0-9]+)/(?P<system_user_id>[0-9]+)/'
,
ProxyWe
h
SocketHandler
),
(
r'/ws/proxy/(?P<asset_id>[0-9]+)/(?P<system_user_id>[0-9]+)/'
,
ProxyWe
b
SocketHandler
),
(
r'/ws/session/(?P<session_id>[0-9]+)/monitor/'
,
MonitorWe
h
SocketHandler
),
(
r'/ws/session/(?P<session_id>[0-9]+)/monitor/'
,
MonitorWe
b
SocketHandler
),
]
]
# prepare may be rewrite it
# prepare may be rewrite it
...
...
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