Skip to content

Instantly share code, notes, and snippets.

@kx499-zz
Created March 15, 2017 00:47
Show Gist options
  • Save kx499-zz/8a40d11c6a2b62627d5ef789b4755938 to your computer and use it in GitHub Desktop.
Save kx499-zz/8a40d11c6a2b62627d5ef789b4755938 to your computer and use it in GitHub Desktop.
MISP ZeroMQ Sub
import zmq
# ZeroMQ Context
context = zmq.Context()
# Define the socket using the "Context"
sock = context.socket(zmq.SUB)
# Define subscription and messages with prefix to accept.
sock.setsockopt(zmq.SUBSCRIBE, "misp_json")
sock.connect("tcp://127.0.0.1:50000")
while True:
message= sock.recv()
print message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment