The Python standard library\'s socket.create_connection()method has a source address option, for controlling which source IP a connection uses.
How do I do the sam
When trying to .connect()
to a remote, I found the answer in the protocol documentation, put the source ip before a semicolon in the connect string:
rc = zmq_connect(socket, "tcp://192.168.1.17:5555;192.168.1.1:5555")
In Python, this looks like:
socket = zmq.Context().socket(zmq.SUB)
socket.connect('tcp://192.168.1.17:5555;192.168.1.1:5555')