File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 2
2
import signal
3
3
import socket
4
4
import threading
5
+ import hashlib
5
6
6
7
from werkzeug .serving import run_simple
7
8
from werkzeug .debug import DebuggedApplication
@@ -46,7 +47,10 @@ def __init__(
46
47
47
48
def _register_zeroconf (self ):
48
49
if self .labthing :
49
- print (f"Registering zeroconf { self .labthing .safe_title } ._labthing._tcp.local." )
50
+ host = f"{ self .labthing .safe_title } ._labthing._tcp.local."
51
+ if len (host ) > 63 :
52
+ host = f"{ hashlib .sha1 (host .encode ()).hexdigest ()} ._labthing._tcp.local."
53
+ print (f"Registering zeroconf { host } " )
50
54
# Get list of host addresses
51
55
mdns_addresses = {
52
56
socket .inet_aton (i )
@@ -57,7 +61,7 @@ def _register_zeroconf(self):
57
61
self .service_infos .append (
58
62
ServiceInfo (
59
63
"_labthing._tcp.local." ,
60
- f" { self . labthing . safe_title } ._labthing._tcp.local." ,
64
+ host ,
61
65
port = self .port ,
62
66
properties = {
63
67
"path" : self .labthing .url_prefix ,
You can’t perform that action at this time.
0 commit comments