Enable unix socket to work with token plugin
This commit adds support to unix sockets in the token plugin, thus it is possible to have a token files like: token: unix_socket:/path/to/socket_file A single websockify instance will be able to handle multiple sockets. Signed-off-by: Jose Ricardo Ziviani <jose@ziviani.net>
This commit is contained in:
@@ -93,6 +93,16 @@ class ProxyRequestHandlerTestCase(unittest.TestCase):
|
||||
self.assertEqual(host, "some host")
|
||||
self.assertEqual(port, "some port")
|
||||
|
||||
def test_get_target_unix_socket(self):
|
||||
class TestPlugin(token_plugins.BasePlugin):
|
||||
def lookup(self, token):
|
||||
return ("unix_socket", "/tmp/socket")
|
||||
|
||||
_, socket = self.handler.get_target(
|
||||
TestPlugin(None), self.handler.path)
|
||||
|
||||
self.assertEqual(socket, "/tmp/socket")
|
||||
|
||||
def test_get_target_raises_error_on_unknown_token(self):
|
||||
class TestPlugin(token_plugins.BasePlugin):
|
||||
def lookup(self, token):
|
||||
|
||||
Reference in New Issue
Block a user