Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
vncproxy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
905fc273
authored
Mar 03, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix exception handling
parent
d6d1303e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
proxy.py
+8
-2
No files found.
proxy.py
View file @
905fc273
...
@@ -20,7 +20,7 @@ import optparse
...
@@ -20,7 +20,7 @@ import optparse
import
logging
import
logging
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
PROXY_SECRET
=
environ
.
get
(
'PROXY_SECRET'
)
PROXY_SECRET
=
environ
[
'PROXY_SECRET'
]
KEY_MAX_AGE
=
environ
.
get
(
'KEY_MAX_AGE'
,
300
)
KEY_MAX_AGE
=
environ
.
get
(
'KEY_MAX_AGE'
,
300
)
...
@@ -70,6 +70,11 @@ class ProxyClientFactory(protocol.ReconnectingClientFactory):
...
@@ -70,6 +70,11 @@ class ProxyClientFactory(protocol.ReconnectingClientFactory):
self
.
cli_queue
=
cli_queue
self
.
cli_queue
=
cli_queue
self
.
src
=
src
self
.
src
=
src
def
clientConnectionFailed
(
self
,
connector
,
reason
):
self
.
srv_queue
.
put
(
False
)
logger
.
error
(
"Client(
%
s): unable to connect to qemu:
%
s"
,
self
.
src
,
reason
)
class
VNCWebSocketHandler
(
Protocol
):
class
VNCWebSocketHandler
(
Protocol
):
def
makeConnection
(
self
,
transport
):
def
makeConnection
(
self
,
transport
):
...
@@ -84,8 +89,9 @@ class VNCWebSocketHandler(Protocol):
...
@@ -84,8 +89,9 @@ class VNCWebSocketHandler(Protocol):
port
=
value
[
'port'
]
port
=
value
[
'port'
]
host
=
value
[
'host'
]
host
=
value
[
'host'
]
except
Exception
as
e
:
except
Exception
as
e
:
src
=
getattr
(
self
,
'src'
,
None
)
logger
.
warning
(
'Server(
%
s): bad connection, key=
%
s err=
%
s'
,
logger
.
warning
(
'Server(
%
s): bad connection, key=
%
s err=
%
s'
,
s
elf
.
s
rc
,
transport
.
request
.
args
[
'd'
][
0
],
e
)
src
,
transport
.
request
.
args
[
'd'
][
0
],
e
)
transport
.
loseConnection
()
transport
.
loseConnection
()
return
return
logger
.
info
(
"Server(
%
s): new connection, host=
%
s, port=
%
s"
,
logger
.
info
(
"Server(
%
s): new connection, host=
%
s, port=
%
s"
,
...
...
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