def setup_client(client_secret_file, server_public_file, endpoint='tcp://127.0.0.1:9000'):
 client = zmq.Context.instance().socket(zmq.DEALER)
 (client_public, client_secret) = zmq.auth.load_certificate(client_secret_file)
 client.curve_secretkey = client_secret
 client.curve_publickey = client_public
 (server_public, _) = zmq.auth.load_certificate(server_public_file)
 client.curve_serverkey = server_public
 client.connect(endpoint)
 client_stream = zmqstream.ZMQStream(client)
 client_stream.on_recv(client_msg_recvd)
 return client_stream

def setup_client ( client_secret_file , server_public_file , endpoint = 'tcp://127.0.0.1:9000' ) : client = zmq . Context . instance ( ) . socket ( zmq . DEALER ) ( client_public , client_secret ) = zmq . auth . load_certificate ( client_secret_file ) client . curve_secretkey = client_secret client . curve_publickey = client_public ( server_public , _ ) = zmq . auth . load_certificate ( server_public_file ) client . curve_serverkey = server_public client . connect ( endpoint ) client_stream = zmqstream . ZMQStream ( client ) client_stream . on_recv ( client_msg_recvd ) return client_stream
setup a simple client with curve auth .