sam.roberts55 sam.roberts55 - 4 months ago 34
Ruby Question

how to get ip address from hidemyass2 gem response

Got a slight issue at the moment

i'm getting this passed back to me at the moment

<HideMyAss::Proxy::Hidester https://198.50.142.47:3128>


this appears in my byebug if i put in proxy.first

How do i get it so it just shows the ip address? I'm sure this is simpel im just being dumb at the moment

Sam

Answer

According to the implementation on the module, https://github.com/appPlant/hidemyass2/blob/master/lib/hidemyass/proxy/hidester.rb. It has a method call ip

So to get the IP address you can try

proxy.first.ip