werner/amatista

client IP

5nyper opened this issue · 6 comments

How do I go about getting a visitor's IP?

Good one, hehe, I'm working right now on implementing sessions, this will be my next step.

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.

Oh nice, looking forward to it

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.

You can deploy crystal apps with nginx?

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 :).