@@ -79,12 +79,13 @@ def get_tokens_for_addr(self, addr):
7979
8080
8181class MetadataDictProxy (DictProxy ):
82- def __init__ (self , notifier , metadata , iroh_relay = None , turn_hostname = None ):
82+ def __init__ (self , notifier , metadata , iroh_relay = None , turn_hostname = None , turn_socket_path = None ):
8383 super ().__init__ ()
8484 self .notifier = notifier
8585 self .metadata = metadata
8686 self .iroh_relay = iroh_relay
8787 self .turn_hostname = turn_hostname
88+ self .turn_socket_path = turn_socket_path
8889
8990 def handle_lookup (self , parts ):
9091 # Lpriv/43f5f508a7ea0366dff30200c15250e3/devicetoken\tlkj123poi@c2.testrun.org
@@ -101,7 +102,7 @@ def handle_lookup(self, parts):
101102 return f"O{ self .iroh_relay } \n "
102103 case "turn" :
103104 try :
104- res = turn_credentials ()
105+ res = turn_credentials (self . turn_socket_path )
105106 except Exception :
106107 logging .exception ("failed to get TURN credentials" )
107108 return "N\n "
@@ -135,6 +136,7 @@ def main():
135136 config = read_config (config_path )
136137 iroh_relay = config .iroh_relay
137138 mail_domain = config .mail_domain
139+ socket_path = config .turn_socket_path
138140
139141 vmail_dir = config .mailboxes_dir
140142 if not vmail_dir .exists ():
@@ -152,6 +154,7 @@ def main():
152154 metadata = metadata ,
153155 iroh_relay = iroh_relay ,
154156 turn_hostname = mail_domain ,
157+ turn_socket_path = socket_path ,
155158 )
156159
157160 dictproxy .serve_forever_from_socket (socket )
0 commit comments