Re: [racket-users] How to obtain the public IP of the sender of an HTTP request?

2018-04-17 Thread Matthew Butterick
PS if you're running the Racket web server as a proxy behind Apache, then `request-client-ip` will always be the localhost IP. However, Apache stores the original request IP in special header called X-Forwarded-For [1] which can be retrieved like so: (dict-ref (request-headers req) 'x-forwarded

Re: [racket-users] How to obtain the public IP of the sender of an HTTP request?

2018-04-17 Thread David Storrs
Ugh. How did I miss that? Thanks, Jay. On Tue, Apr 17, 2018 at 4:31 PM, Jay McCarthy wrote: > request-client-ip on the request object your handler gets. > > Jay > > On Tue, Apr 17, 2018 at 2:54 PM, David Storrs wrote: >> Assume I'm a web server and one of the requests I want to respond to >> i

Re: [racket-users] How to obtain the public IP of the sender of an HTTP request?

2018-04-17 Thread Jay McCarthy
request-client-ip on the request object your handler gets. Jay On Tue, Apr 17, 2018 at 2:54 PM, David Storrs wrote: > Assume I'm a web server and one of the requests I want to respond to > is "What is my public IP address?" More specifically, if the server > receives an HTTP request to, let's s

Re: [racket-users] Reimplementing Hackett’s type language: expanding to custom core forms in Racket

2018-04-17 Thread Stephen Chang
Hi Alexis, Great article. And timely too, since it addresses some of the same usage issues of local-expand and stoplists that we ran into with Turnstile. (I'm also interested in why the core forms are added to the stop list. Is it because of let-syntax? I know it's probably been mentioned before

[racket-users] How to obtain the public IP of the sender of an HTTP request?

2018-04-17 Thread David Storrs
Assume I'm a web server and one of the requests I want to respond to is "What is my public IP address?" More specifically, if the server receives an HTTP request to, let's say, the ".../get-ip" endpoint then it should send back an HTTP response containing the sender's public IP. cf https://www.ip

Re: [racket-users] [racket] error : Attempted to use a higher-order value passed as `Any` in untyped code:

2018-04-17 Thread Alex Knauth
This is interesting. The `Any` type in Typed Racket includes values that may have higher-order "original" types. For example, it may have originally been a typed function (-> Fixnum Fixnum) or (-> String Boolean), such that if you call it without a contract guarding it, it should be an error. Th