immateriel/im_sync — pull request #1 by vdaubry (2014-05-22 12:48:07+00:00)
Title: Check immateriel ip

When the web server is behind a proxy it should check for ```HTTP_X_REAL_IP``` or ```HTTP_X_FORWARDED_FOR``` instead of ```REMOTE_ADDR```

Sample request :

```
{"CONTENT_LENGTH"=>"6713", "CONTENT_TYPE"=>"application/x-www-form-urlencoded", "GATEWAY_INTERFACE"=>"CGI/1.1", "PATH_INFO"=>"/receive", "QUERY_STRING"=>"", "REMOTE_ADDR"=>"127.0.0.1", "REMOTE_HOST"=>"localhost", "REQUEST_METHOD"=>"POST", "REQUEST_URI"=>"http://3843c6be.ngrok.com/receive", "SCRIPT_NAME"=>"", "SERVER_NAME"=>"3843c6be.ngrok.com", "SERVER_PORT"=>"80", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24)", "HTTP_HOST"=>"3843c6be.ngrok.com", "HTTP_X_REAL_IP"=>"77.247.182.210", "HTTP_X_FORWARDED_PROTO"=>"http", "HTTP_CONNECTION"=>"close", "HTTP_ACCEPT"=>"*/*", "HTTP_USER_AGENT"=>"Ruby", "rack.version"=>[1, 2], "rack.input"=>#>, "rack.errors"=>#>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "rack.url_scheme"=>"http", "HTTP_VERSION"=>"HTTP/1.1", "REQUEST_PATH"=>"/receive"}
```