Class: Ronin::RPC::PHP::Client
- Inherits:
-
RPC::Client
- Object
- RPC::Client
- Ronin::RPC::PHP::Client
- Defined in:
- lib/ronin/rpc/php/client.rb
Instance Attribute Summary collapse
-
#proxy ⇒ Object
Proxy to send requests through.
-
#session ⇒ Object
readonly
Session data.
-
#url ⇒ Object
readonly
URL of RPC server.
-
#user_agent ⇒ Object
User-Agent string to send with each request.
Instance Method Summary collapse
- #call_url(call_object) ⇒ Object
-
#fingerprint ⇒ Object
Returns a finger-print of the PHP server.
-
#initialize(url, options = {}) ⇒ Client
constructor
Creates a new Client object with the specified url and the given options.
-
#running? ⇒ Boolean
Returns
true
if the RPC server is running and responding to function calls, returnsfalse
otherwise.
Constructor Details
#initialize(url, options = {}) ⇒ Client
Creates a new Client object with the specified url and the given options.
options may contain the following keys:
:proxy
-
The proxy settings to use when communicating with the server.
:user_agent
-
The User-Agent to send to the server.
:user_agent_alias
-
The User-Agent alias to send to the server.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/ronin/rpc/php/client.rb', line 65 def initialize(url,={}) @url = url @proxy = [:proxy] if [:user_agent_alias] @user_agent = Web.user_agent_alias[[:user_agent_alias]] else @user_agent = [:user_agent] end @cookie = nil @session = {} end |
Instance Attribute Details
#proxy ⇒ Object
Proxy to send requests through
40 41 42 |
# File 'lib/ronin/rpc/php/client.rb', line 40 def proxy @proxy end |
#session ⇒ Object (readonly)
Session data
46 47 48 |
# File 'lib/ronin/rpc/php/client.rb', line 46 def session @session end |
#url ⇒ Object (readonly)
URL of RPC server
37 38 39 |
# File 'lib/ronin/rpc/php/client.rb', line 37 def url @url end |
#user_agent ⇒ Object
User-Agent string to send with each request
43 44 45 |
# File 'lib/ronin/rpc/php/client.rb', line 43 def user_agent @user_agent end |
Instance Method Details
#call_url(call_object) ⇒ Object
80 81 82 83 84 85 |
# File 'lib/ronin/rpc/php/client.rb', line 80 def call_url(call_object) new_url = URI(@url.to_s) new_url.query_params['rpc_call'] = call_object.encode(@session) return new_url end |
#fingerprint ⇒ Object
Returns a finger-print of the PHP server.
98 99 100 |
# File 'lib/ronin/rpc/php/client.rb', line 98 def fingerprint call(:fingerprint) end |
#running? ⇒ Boolean
Returns true
if the RPC server is running and responding to function calls, returns false
otherwise.
91 92 93 |
# File 'lib/ronin/rpc/php/client.rb', line 91 def running? call(:running) end |