Sergey Volkov
2008-Mar-07 17:05 UTC
How to determine remote IP address in ActionWebService API''s
Hello all! I trying to create XMLRPC service with ActionWebService plugin and Rails 2.0.2. I use conventional layered based API. This is my controller: class RpcController < ApplicationController skip_before_filter :verify_authenticity_token web_service_dispatching_mode :layered web_service :user, UserRpcService.new end And service: class UserRpcService < ActionWebService::Base web_service_api UserRpcAPI def auth(login, passwd) user = User::find(:first, :conditions => {:login => login, :passwd => passwd}) raise UserAuthException, "Auth failed" unless user.instance_of? (User) true end end In method UserRpcService.auth i need to know from which remote IP this RPC call is come (for logging or restrictions etc.). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---