Created
July 8, 2019 13:08
-
-
Save corenting/edbc0110621bd1331d4e49698b6ed25f to your computer and use it in GitHub Desktop.
CLI statsd debug server - needs Python3
This file contains hidden or 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 | |
# encoding: utf-8 | |
import datetime | |
import socket | |
UDP_IP = "127.0.0.1" | |
UDP_PORT = 8125 | |
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
sock.bind((UDP_IP, UDP_PORT)) | |
while True: | |
data, addr = sock.recvfrom(1024) | |
print(datetime.datetime.now(), data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See https://github.com/corenting/cookies for a rewrite in Go