Ivars 5 년 전
부모
커밋
9d2c15f05d
1개의 변경된 파일8개의 추가작업 그리고 4개의 파일을 삭제
  1. 8
    4
      playstreamproxy.py

+ 8
- 4
playstreamproxy.py 파일 보기

@@ -297,10 +297,12 @@ class StreamHandler(BaseHTTPRequestHandler):
297 297
 class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
298 298
     """Handle requests in a separate thread."""
299 299
 
300
-def start(host = HOST_NAME, port = PORT_NUMBER, redirect=REDIRECT):
301
-    global REDIRECT
300
+def start(host = HOST_NAME, port = PORT_NUMBER, key=KEY, redirect=REDIRECT):
301
+    global REDIRECT,KEY
302 302
     if redirect:
303 303
         REDIRECT = redirect
304
+    if key:
305
+        KEY = key
304 306
     httpd = ThreadedHTTPServer((host, port), StreamHandler)
305 307
     print time.asctime(), "Server Starts - %s:%s" % (HOST_NAME, PORT_NUMBER)
306 308
     try:
@@ -310,10 +312,12 @@ def start(host = HOST_NAME, port = PORT_NUMBER, redirect=REDIRECT):
310 312
     httpd.server_close()
311 313
     print time.asctime(), "Server Stops - %s:%s" % (HOST_NAME, PORT_NUMBER)
312 314
 
313
-def start2(host = HOST_NAME, port = PORT_NUMBER, redirect=REDIRECT,workers=WORKERS):
314
-    global REDIRECT
315
+def start2(host = HOST_NAME, port = PORT_NUMBER, redirect=REDIRECT, key=KEY, workers=WORKERS):
316
+    global REDIRECT,KEY
315 317
     if redirect:
316 318
         REDIRECT = redirect
319
+    if key:
320
+        KEY = key
317 321
 
318 322
     print time.asctime(), "Server Starts - %s:%s" % (host, port)
319 323
     addr = ('', port)