The ```Msf::Exploit::Remote::HttpClient``` mixin already provides you with a ```peer``` method like this one, so I think you can safely delete it from the module.