Created
June 21, 2020 04:20
-
-
Save ssadler/aef35f0cbe79a38e08b59e8aa8443cc8 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python3 | |
import binascii | |
import gevent | |
import struct | |
from gevent import socket | |
def init_peer(peer, port): | |
sends = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sends.connect(peer) | |
sends.sendall(b'\0' + struct.pack('>H', port)) | |
while True: | |
sends.sendall(binascii.unhexlify(b'000000000000000000000000000000000000000000')) | |
PEER = ('127.0.0.1', 40440) | |
if __name__ == '__main__': | |
threads = [] | |
threads.append(gevent.spawn(init_peer, PEER, 8888)) | |
gevent.joinall(threads) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment