Hi,
I want to get the ip adress of the user with: self requestContext request remoteAddress But this returns always 127.0.0.1, also on the remote system. E.g. http://ec2-176-34-68-88.eu-west-1.compute.amazonaws.com/ in the first line of the page, I did html text: self requestContext request remoteAddress. I would expect the ip adress of my provider Did I miss somethng? Sabine |
If there is a Http proxy running on your server you will get its ip address.
On Thursday, 11 April 2013, Sabine Knöfel <[hidden email]> wrote: > Hi, > > I want to get the ip adress of the user with: > > self requestContext request remoteAddress > > But this returns always 127.0.0.1, also on the remote system. > > E.g. http://ec2-176-34-68-88.eu-west-1.compute.amazonaws.com/ > in the first line of the page, I did > > html text: self requestContext request remoteAddress. > > I would expect the ip adress of my provider > > Did I miss somethng? > > Sabine > > > > -- > View this message in context: http://forum.world.st/self-requestContext-request-remoteAddress-always-127-0-0-1-tp4680862.html > Sent from the Seaside General mailing list archive at Nabble.com. > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > -- Milan Mimica http://sparklet.sf.net _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Sabine,
if you have a normal setup that would mean you use a front-end web server that accepts requests and forward them to the smalltalk image. In this case the connection would go from 127.0.0.1 to 127.0.0.1 so the information you are requesting is valid. In this case it is also common that the front-end server writes the originating IP address in a http header. Have a look at Then I would advize to have a look at the headers of the request in self requestContext request headers to find any header containing the information you are looking for in case it is not the one above. Norbert Am 11.04.2013 um 17:21 schrieb Milan Mimica <[hidden email]>: If there is a Http proxy running on your server you will get its ip address. _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Hi Norbert,
I found it in the "x-forwarded-for" entry header dict. Thank you! Sabine On Thu, Apr 11, 2013 at 5:36 PM, Norbert Hartl [via Smalltalk] <[hidden email]> wrote: > Sabine, > > if you have a normal setup that would mean you use a front-end web server > that accepts requests and forward them to the smalltalk image. In this case > the connection would go from 127.0.0.1 to 127.0.0.1 so the information you > are requesting is valid. In this case it is also common that the front-end > server writes the originating IP address in a http header. Have a look at > > http://en.wikipedia.org/wiki/X-Forwarded-For > > Then I would advize to have a look at the headers of the request in > > self requestContext request headers > > to find any header containing the information you are looking for in case it > is not the one above. > > Norbert > > Am 11.04.2013 um 17:21 schrieb Milan Mimica <[hidden email]>: > > If there is a Http proxy running on your server you will get its ip address. > > > On Thursday, 11 April 2013, Sabine Knöfel <[hidden email]> wrote: >> Hi, >> >> I want to get the ip adress of the user with: >> >> self requestContext request remoteAddress >> >> But this returns always 127.0.0.1, also on the remote system. >> >> E.g. http://ec2-176-34-68-88.eu-west-1.compute.amazonaws.com/ >> in the first line of the page, I did >> >> html text: self requestContext request remoteAddress. >> >> I would expect the ip adress of my provider >> >> Did I miss somethng? >> >> Sabine >> >> >> >> -- >> View this message in context: >> http://forum.world.st/self-requestContext-request-remoteAddress-always-127-0-0-1-tp4680862.html >> Sent from the Seaside General mailing list archive at Nabble.com. >> _______________________________________________ >> seaside mailing list >> [hidden email] > >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside >> > > -- > Milan Mimica > http://sparklet.sf.net > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > > > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > > ________________________________ > If you reply to this email, your message will be added to the discussion > below: > http://forum.world.st/self-requestContext-request-remoteAddress-always-127-0-0-1-tp4680862p4680880.html > To unsubscribe from self requestContext request remoteAddress always > 127.0.0.1, click here. > NAML |
In reply to this post by NorbertHartl
If you are using nginx as a front-end proxy, you can transmit the IP address of the requester like this:
location / { proxy_pass <a href="http://localhost:5984;">http://localhost:5984; proxy_set_header X-Real-IP $remote_addr; } On 11 Apr 2013, at 17:35, Norbert Hartl <[hidden email]> wrote: > Sabine, > > if you have a normal setup that would mean you use a front-end web server that accepts requests and forward them to the smalltalk image. In this case the connection would go from 127.0.0.1 to 127.0.0.1 so the information you are requesting is valid. In this case it is also common that the front-end server writes the originating IP address in a http header. Have a look at > > http://en.wikipedia.org/wiki/X-Forwarded-For > > Then I would advize to have a look at the headers of the request in > > self requestContext request headers > > to find any header containing the information you are looking for in case it is not the one above. > > Norbert > > Am 11.04.2013 um 17:21 schrieb Milan Mimica <[hidden email]>: > >> If there is a Http proxy running on your server you will get its ip address. >> >> >> On Thursday, 11 April 2013, Sabine Knöfel <[hidden email]> wrote: >> > Hi, >> > >> > I want to get the ip adress of the user with: >> > >> > self requestContext request remoteAddress >> > >> > But this returns always 127.0.0.1, also on the remote system. >> > >> > E.g. http://ec2-176-34-68-88.eu-west-1.compute.amazonaws.com/ >> > in the first line of the page, I did >> > >> > html text: self requestContext request remoteAddress. >> > >> > I would expect the ip adress of my provider >> > >> > Did I miss somethng? >> > >> > Sabine >> > >> > >> > >> > -- >> > View this message in context: http://forum.world.st/self-requestContext-request-remoteAddress-always-127-0-0-1-tp4680862.html >> > Sent from the Seaside General mailing list archive at Nabble.com. >> > _______________________________________________ >> > seaside mailing list >> > [hidden email] >> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside >> > >> >> -- >> Milan Mimica >> http://sparklet.sf.net >> _______________________________________________ >> seaside mailing list >> [hidden email] >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Hi Johann,
thank you for your answer. I use the "x-forwarded-for" entry header dict, which was suggested by Norbert. Sabine |
Am 13.04.2013 um 13:49 schrieb Sabine Knöfel <[hidden email]>: > Hi Johann, > > thank you for your answer. > I use the "x-forwarded-for" entry header dict, which was suggested by > Norbert. Just a little note. The X-Fowarded-For header is a list of IPs. The idea is that every proxy/server that mangels the request is added to the list of IPs. So if you do ($, split: (headerString copyWithout: Character space)) first you get the first IP which should be the client. I think in most cases you'll find a single ip but the above is more safe. The proposal of Johan is to use nginx as a helper to ease this process. By using the real ip module in nginx the server selects one address from available sources and sets a specific header. Might be a good idea to use it that way. At least I can find in my server configs the exact same line that Johan proposed. And that means he stole it from server. Damn you, belgian hacker! Norbert_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
On 13 Apr 2013, at 14:20, Norbert Hartl <[hidden email]> wrote: > At least I can find in my server configs the exact same line that Johan proposed. And that means he stole it from server. Damn you, belgian hacker! The Russians got to it first [1] !!! ;-) [1] http://wiki.nginx.org/HttpProxyModule_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
The germans will use it as soon as they need it;-)
I am only logging the ip adresses of my users. So long this solution is enough for me. Thanks! On Sat, Apr 13, 2013 at 7:19 PM, Johan Brichau-2 [via Smalltalk] <[hidden email]> wrote: > > On 13 Apr 2013, at 14:20, Norbert Hartl <[hidden email]> wrote: > >> At least I can find in my server configs the exact same line that Johan >> proposed. And that means he stole it from server. Damn you, belgian hacker! > > The Russians got to it first [1] !!! ;-) > > [1] > http://wiki.nginx.org/HttpProxyModule_______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > > ________________________________ > If you reply to this email, your message will be added to the discussion > below: > http://forum.world.st/self-requestContext-request-remoteAddress-always-127-0-0-1-tp4680862p4681257.html > To unsubscribe from self requestContext request remoteAddress always > 127.0.0.1, click here. > NAML |
Norbert
_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Ups, sorry.
You are from Cologne...nice Town! I did misunderstand the conversation about the russians and belgians. Greetings from sunny Freiburg Sabine On Sun, Apr 14, 2013 at 12:00 AM, Norbert Hartl [via Smalltalk] <[hidden email]> wrote: > > > Am 13.04.2013 um 20:16 schrieb Sabine Knöfel <[hidden email]>: > > The germans will use it as soon as they need it;-) > > > Strong statement! Where do you think I'm from? Small hint: The distance > between you and me is roughly twice as much as between Johan and me :) > > Norbert > > I am only logging the ip adresses of my users. > So long this solution is enough for me. > Thanks! > > On Sat, Apr 13, 2013 at 7:19 PM, Johan Brichau-2 [via Smalltalk] > <[hidden email]> wrote: > >> >> On 13 Apr 2013, at 14:20, Norbert Hartl <[hidden email]> wrote: >> >>> At least I can find in my server configs the exact same line that Johan >>> proposed. And that means he stole it from server. Damn you, belgian >>> hacker! >> >> The Russians got to it first [1] !!! ;-) >> >> [1] >> >> http://wiki.nginx.org/HttpProxyModule_______________________________________________ >> seaside mailing list >> [hidden email] >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside >> >> >> ________________________________ >> If you reply to this email, your message will be added to the discussion >> below: >> >> http://forum.world.st/self-requestContext-request-remoteAddress-always-127-0-0-1-tp4680862p4681257.html >> To unsubscribe from self requestContext request remoteAddress always >> 127.0.0.1, click here. >> NAML > > ________________________________ > View this message in context: Re: self requestContext request remoteAddress > always 127.0.0.1 > > Sent from the Seaside General mailing list archive at Nabble.com. > > _______________________________________________ > > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > > ________________________________ > If you reply to this email, your message will be added to the discussion > below: > http://forum.world.st/self-requestContext-request-remoteAddress-always-127-0-0-1-tp4680862p4681287.html > To unsubscribe from self requestContext request remoteAddress always > 127.0.0.1, click here. > NAML |
Free forum by Nabble | Edit this page |