How to use event_machine in Ruby to bind to an IP when making requests?
I have an app that accesses some web APIs, but they limit me by IP. How can I use EM to bind to another IP that is assigned to me on my dedicated server?
I really hope its as easy as:
http = EM::HttpRequest.new(address).send(method, :query => params, :head => head, :timeout => 13, :redirects => 3, :ip_to_bind_to => '192.168开发者_Go百科.1.22')
i suspect the best way to do this is to configure a static route on your operating system to route the request to the web API thru the desired ip address.
what are to routes of your system?
where is the default gw?
精彩评论