Compare commits

..

2 commits

Author SHA1 Message Date
511d58e9c5 Use correct ip
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-11-04 00:04:15 +01:00
7c7397d7a7 Add container url to readme 2023-11-04 00:03:30 +01:00
2 changed files with 4 additions and 4 deletions

View file

@ -1,7 +1,7 @@
# 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.

View file

@ -26,11 +26,11 @@ while True:
ips = pl.split("\t")[3]
for ip in ips.split(","):
if ip.endswith("/32"):
print(ip[:-3])
print(f"{ip}:{UDP_PORT} {MESSAGE=}" % MESSAGE)
UDP_IP = ip[:-3]
print(f"{UDP_IP}:{UDP_PORT} {MESSAGE=}" % MESSAGE)
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.sendto(MESSAGE, (ip, UDP_PORT))
sock.sendto(MESSAGE, (UDP_IP, UDP_PORT))
sock.close()
time.sleep(10)