Created
November 28, 2013 09:20
-
-
Save GaretJax/7689247 to your computer and use it in GitHub Desktop.
Set fastrouter mapping (not tested)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import struct | |
ip = '127.0.0.1' | |
port = 5005 | |
payload = { | |
'key': '', | |
'address': '', | |
} | |
msg = '' | |
for k, v in payload.iteritems(): | |
msg += struct.pack('<h', len(k)) + k | |
msg += struct.pack('<h', len(v)) + v | |
msg = struct.pack('<BhB', 224, len(msg), 0) + msg | |
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
sock.sendto(msg, (ip, port)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment