質問

To cut the story short: is there any way to get IP of untrusted client calling remote proxy object, using Pyro4?

So person A is calling my object from IP 123.123.123.123 and person B from IP 111.111.111.111 is there any way to distinguish them in Pyro4, assuming that they cannot be trusted enough to submit their own IP.

役に立ちましたか?

解決

I ran across your question when looking for the same thing. If I understand, on the server side you want to know the IP address the client's socket is connected from, right? If so, this'll do it:

Pyro4.current_context.client.sock.getpeername()[0]

Found that in this section of the Pyro4 user's guide

他のヒント

Here is my solution to my problem: since I didn't really need to get specific addresses of clients using pyro, just to distinguish clients in specific subnet (in my classrom) from other ips (students working from home). I just started two pyro clients on two ports and then filtered traffic using a firewall.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top