-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use remote_ip method #141
Comments
Odd, to say the least. Are you sure your runtime is not pulling in an older version by accident? |
Here is my Gemfile.lock
|
+1 @IMcPwn temporal "monkey patch": |
I found that for some reason the em-websocket gem from https://rubygems.org/gems/em-websocket doesn't contain remote_ip method even though it's version is 0.5.1. |
I ran into this tonight myself. I've never used this library before, and it's never been installed anywhere on my machine before tonight. [5] pry(Minion::Service)> ws
=> #<EventMachine::WebSocket::Connection:0x00007fc7a38cf970
@close_timeout=nil,
@debug=false,
@handler=#<EventMachine::WebSocket::Handler13:0x00007fc7a61af5c0 @application_data_buffer="", @close_timer=nil, @connection=#<EventMachine::WebSocket::Connection:0x00007fc7a38cf970 ...>, @data="", @debug=false, @frame_type=nil, @state=:connected>,
@handshake=nil,
@onclose=#<Proc:0x00007fc7a38cf3f8 /Users/jah/OneDrive/Projects/minion/api/service.rb:28>,
@onmessage=#<Proc:0x00007fc7a38cf380 /Users/jah/OneDrive/Projects/minion/api/service.rb:30>,
@onopen=#<Proc:0x00007fc7a38cf420 /Users/jah/OneDrive/Projects/minion/api/service.rb:16>,
@options={:host=>"0.0.0.0", :port=>9000, :secure=>true, :tls_options=>{:private_key_file=>"/Users/jah/OneDrive/Projects/minion/api/service/ssl/server.key", :cert_chain_file=>"/Users/jah/OneDrive/Projects/minion/api/service/ssl/server.crt"}},
@secure=true,
@secure_proxy=false,
@signature=3,
@tls_options={:private_key_file=>"/Users/jah/OneDrive/Projects/minion/api/service/ssl/server.key", :cert_chain_file=>"/Users/jah/OneDrive/Projects/minion/api/service/ssl/server.crt"}>
[6] pry(Minion::Service)> ws.remote_ip
NoMethodError: undefined method `remote_ip' for #<EventMachine::WebSocket::Connection:0x00007fc7a38cf970>
from (pry):6:in `block (3 levels) in start'
[7] pry(Minion::Service)> Gemfile.lock:
Following @smallfish135's comment, I also tested this with the version from GitHub, tag 'v0.5.1', and got the same problem. So it looks like both Rubygems.org and Github don't have this available (in other words, the gems are probably the same). For now I've just implemented the monkey patch above and it works fine, but I figured since it's been over a year since the last response, I'd "bump" this issue with some timely status information. |
Here's an example WebSocket connection:
I want to get the IP address of the remote host, so I use remote_ip like in commit 705c9f1.
However if I use the code inside of the remote_ip method I get this:
Why wouldn't I have the remote_ip method? I'm using version 0.5.1 of the gem.
The text was updated successfully, but these errors were encountered: