From 7d5c3dcd969161322deed6c43f8a6a3cb92c3369 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 11 Nov 2014 11:53:55 -0500 Subject: upgrade to 14.4.1 --- examples/security/grasslands.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 examples/security/grasslands.py (limited to 'examples/security/grasslands.py') diff --git a/examples/security/grasslands.py b/examples/security/grasslands.py new file mode 100644 index 0000000..cbd3ab9 --- /dev/null +++ b/examples/security/grasslands.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +''' +No protection at all. + +All connections are accepted, there is no authentication, and no privacy. + +This is how ZeroMQ always worked until we built security into the wire +protocol in early 2013. Internally, it uses a security mechanism called +"NULL". + +Author: Chris Laws +''' + +import zmq + + +ctx = zmq.Context().instance() + +server = ctx.socket(zmq.PUSH) +server.bind('tcp://*:9000') + +client = ctx.socket(zmq.PULL) +client.connect('tcp://127.0.0.1:9000') + +server.send(b"Hello") +msg = client.recv() +if msg == b"Hello": + print("Grasslands test OK") -- cgit v1.2.3