Commit 2ee60a87 by Bach Dániel

remove hard-coded key, max_age

parent b11d7197
......@@ -3,6 +3,7 @@
# http://musta.sh/2012-03-04/twisted-tcp-proxy.html
import sys
from os import environ
from twisted.internet import defer
from twisted.internet import protocol
......@@ -16,6 +17,9 @@ from websockets import WebSocketsResource, lookupProtocolForFactory
from django.core import signing
PROXY_SECRET = environ.get('PROXY_SECRET')
KEY_MAX_AGE = environ.get('KEY_MAX_AGE', 300)
class ProxyClientProtocol(protocol.Protocol):
def connectionMade(self):
......@@ -61,7 +65,7 @@ class VNCWebSocketHandler(Protocol):
def makeConnection(self, transport):
try:
value = signing.loads(transport.request.args['d'][0],
key='asdasd', max_age=300)
Please register or sign in to reply
key=PROXY_SECRET, max_age=KEY_MAX_AGE)
Please register or sign in to reply
port = value['port']
host = value['host']
except:
......
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 sign in to comment