Created
March 15, 2017 00:47
-
-
Save kx499-zz/8a40d11c6a2b62627d5ef789b4755938 to your computer and use it in GitHub Desktop.
MISP ZeroMQ Sub
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
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