import zmq
context = zmq.Context()
#  Socket to talk to server
print("Connecting to hello world server…")

if 1:
    socket1 = context.socket(zmq.ROUTER)
    socket1.bind("tcp://*:5555")
    socket2 = context.socket(zmq.DEALER)
    socket2.bind("tcp://*:6666")
else:
    socket1 = context.socket(zmq.XSUB)
    socket1.bind("tcp://*:5555")
    socket2 = context.socket(zmq.XPUB)
    socket2.bind("tcp://*:6666")

zmq.proxy(socket1, socket2)
