[zeromq-dev] Obtaining IP adress a message is sent from
Pieter Hintjens
ph at imatix.com
Thu Feb 14 04:25:52 CET 2013
Hi Niels,
0MQ doesn't give you the connection endpoint and in any case this
isn't reliable when connections cross firewalls. Nor is that enough
for a return connection in many cases -- you need to add a port number
if you're accepting incoming connections on a different port. What we
do, and it's quite clean, is to pass a connection endpoint in a hello
message, with a protocol that handles discovery and interconnection.
You can see an example of this in Chapter 8 of the Guide.
-Pieter
On Sun, Feb 10, 2013 at 1:57 PM, Niels Berglund
<niels.it.berglund at gmail.com> wrote:
> Hi!
> I have a scenario where (for various reasons, fraud, etc) I need to know
> where a particular message comes from. I.e. a "client" connects to my
> "server" and subsequently sends messages. When the "service" receives the
> message, it needs to obtain the ip-address the message originated from and
> inject that in the message - could potentially be a 0MQ message frame -
> which then is forwarded to some other service, handling this particular
> message type.
>
> I have not seen any straightforward way of doing this in 0MQ - is it
> possible, and if not; could there be some other solution to this (i.e. other
> than the client itself injecting it - which is not a very satisfactory
> solution)?
>
> Thanks!
> Niels
>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
More information about the zeromq-dev
mailing list