Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #60530 > unrolled thread
| Started by | Malte Forkel <malte.forkel@berlin.de> |
|---|---|
| First post | 2013-11-26 18:26 +0100 |
| Last post | 2013-11-26 18:26 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: How to determine whether client and server are on the same host Malte Forkel <malte.forkel@berlin.de> - 2013-11-26 18:26 +0100
| From | Malte Forkel <malte.forkel@berlin.de> |
|---|---|
| Date | 2013-11-26 18:26 +0100 |
| Subject | Re: How to determine whether client and server are on the same host |
| Message-ID | <mailman.3252.1385486790.18130.python-list@python.org> |
Am 26.11.2013 13:26, schrieb Chris Angelico: > If you deliberately create a file with a random name, the chances of > one existing with the same name on the client are infinitesimal unless > someone's deliberately trying to confuse things... in which case I > wouldn't worry about it. > I wouldn't, either. But the server is an existing application that I can't extend. It does not support creating a file with a random name. > No, because there's no such thing as a "local connection". For > instance, I have two internet connections at my house, and I can > telnet out on one of them and back in on the other - but both > connections are NATted, so the machine itself doesn't have an IP that > matches what I'm talking about here. I could have a socket connection > from w.x.y.z port 12345 to a.b.c.d port 80, and there's no way > telnetlib would recognize that as coming back to the same computer, > because this computer's IP addresses are all RFC 1918 ones (127.0.0.1, > 192.168.0.19, 192.168.2.2). > Thanks for the explanation. I guess I was hoping that I could use some property of a connection created with telnetlib or its socket to find out whether it was actually a host-local connection (i.e. a connection to 'localhost', '127.xx.xx.xx' or '<local_host_name>'). So its either your initial suggestion of taking a hint from the user or comparing files on the server and the client.
Back to top | Article view | comp.lang.python
csiph-web