Added --host-token to allow choosing target by hostname.

This commit is contained in:
josedpedroso
2018-07-05 00:54:19 +01:00
parent 44bb213a72
commit af85184e28
3 changed files with 28 additions and 12 deletions
+3 -3
View File
@@ -88,7 +88,7 @@ class ProxyRequestHandlerTestCase(unittest.TestCase):
return ("some host", "some port")
host, port = self.handler.get_target(
TestPlugin(None), self.handler.path)
TestPlugin(None))
self.assertEqual(host, "some host")
self.assertEqual(port, "some port")
@@ -99,7 +99,7 @@ class ProxyRequestHandlerTestCase(unittest.TestCase):
return ("unix_socket", "/tmp/socket")
_, socket = self.handler.get_target(
TestPlugin(None), self.handler.path)
TestPlugin(None))
self.assertEqual(socket, "/tmp/socket")
@@ -109,7 +109,7 @@ class ProxyRequestHandlerTestCase(unittest.TestCase):
return None
self.assertRaises(FakeServer.EClose, self.handler.get_target,
TestPlugin(None), "https://localhost:6080/websockify?token=blah")
TestPlugin(None))
def test_token_plugin(self):
class TestPlugin(token_plugins.BasePlugin):