Compare commits
2 commits
bba9043720
...
511d58e9c5
Author | SHA1 | Date | |
---|---|---|---|
511d58e9c5 | |||
7c7397d7a7 |
2 changed files with 4 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
# bambulab-wireguard-proxy
|
# bambulab-wireguard-proxy
|
||||||
|
|
||||||
```
|
```
|
||||||
docker run --rm -it --network container:firezone-firezone-1 --cap-add NET_ADMIN python:3.11-alpine /bin/sh
|
docker run --rm -it --network container:firezone-firezone-1 --cap-add NET_ADMIN git.f3l.de/asdil12/bambulab-wireguard-proxy:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
Send SSDP announcements that imitate the Bambulab printer to each wireguard peer.
|
Send SSDP announcements that imitate the Bambulab printer to each wireguard peer.
|
||||||
|
|
|
@ -26,11 +26,11 @@ while True:
|
||||||
ips = pl.split("\t")[3]
|
ips = pl.split("\t")[3]
|
||||||
for ip in ips.split(","):
|
for ip in ips.split(","):
|
||||||
if ip.endswith("/32"):
|
if ip.endswith("/32"):
|
||||||
print(ip[:-3])
|
UDP_IP = ip[:-3]
|
||||||
print(f"{ip}:{UDP_PORT} {MESSAGE=}" % MESSAGE)
|
print(f"{UDP_IP}:{UDP_PORT} {MESSAGE=}" % MESSAGE)
|
||||||
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
|
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
|
||||||
sock.bind(('0.0.0.0', 1900)) # 1900 is SSDP src port
|
sock.bind(('0.0.0.0', 1900)) # 1900 is SSDP src port
|
||||||
sock.sendto(MESSAGE, (ip, UDP_PORT))
|
sock.sendto(MESSAGE, (UDP_IP, UDP_PORT))
|
||||||
sock.close()
|
sock.close()
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue