client IP
5nyper opened this issue · 6 comments
5nyper commented
How do I go about getting a visitor's IP?
werner commented
Good one, hehe, I'm working right now on implementing sessions, this will be my next step.
werner commented
I add a method called remote_ip
, but it's not working in localhost, maybe because it needs a proxy server, I'm thinking in deploying an app in heroku and see if it works.
5nyper commented
Oh nice, looking forward to it
werner commented
I can confirm that remote_ip
works using nginx, you just have to add the next in nginx.conf:
http {
server {
listen 3289; # any port
location / {
proxy_pass http://localhost:1234; #the url for amatista web server
}
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
...
Closing the issue, but I still have in mind to do the heroku demo.
5nyper commented
You can deploy crystal apps with nginx?
werner commented
I think so, using nginx as a proxy server you can deploy almost anything, although keep in mind all of these including crystal are still in alpha stage :).