From 0a2dac53bf14489e2cec2c677477ff66926fc032 Mon Sep 17 00:00:00 2001 From: Matthew Balman Date: Wed, 12 Sep 2012 16:36:59 +0000 Subject: [PATCH] Authentication support via any executable, communication via shell args. Based on work by Cliff Cyphers. https://github.com/ccyphers/websockify --- auth.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 auth.py diff --git a/auth.py b/auth.py new file mode 100755 index 0000000..104b369 --- /dev/null +++ b/auth.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +import os + +try: + expected = os.environ['EXPECTED_TOKEN'] + token = os.environ['WEBSOCKIFY_UNSAFE_TOKEN'] +except: + exit(-1) + +print 'expected = ' + expected +print 'token = ' + token + +if expected == token: + exit(0) +else: + exit(1)