Module: Reel::ConnectionMixin
- Included in:
- Connection, WebSocket
- Defined in:
- lib/reel/mixins.rb
Instance Method Summary collapse
-
#remote_host ⇒ Object
Obtain the hostname of the remote connection.
-
#remote_ip ⇒ Object
(also: #remote_addr)
Obtain the IP address of the remote connection.
Instance Method Details
#remote_host ⇒ Object
Obtain the hostname of the remote connection
18 19 20 21 |
# File 'lib/reel/mixins.rb', line 18 def remote_host # NOTE: Celluloid::IO does not yet support non-blocking reverse DNS socket.peeraddr(true)[2] end |
#remote_ip ⇒ Object Also known as: remote_addr
Obtain the IP address of the remote connection
12 13 14 |
# File 'lib/reel/mixins.rb', line 12 def remote_ip socket.peeraddr(false)[3] end |