#!/usr/bin/python3 

import json
import socket

UDP_IP		= "255.255.255.255"
UDP_PORT	= 32145
MESSAGE		= {"subject": "Fotobox Broadcast", "port": 80}

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)

data = json.dumps(MESSAGE, indent=4, sort_keys=True)
data = data.encode("UTF-8")
sock.sendto(data, (UDP_IP, UDP_PORT))
