Module: DuoRuby::Socket::Transport::ClassMethods
- Defined in:
- lib/duoruby/socket/transport.rb
Instance Method Summary collapse
Instance Method Details
#default_socket_url(path = "/duoruby/socket") ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/duoruby/socket/transport.rb', line 41 def default_socket_url(path = "/duoruby/socket") raise "default socket transport is only available under Opal" unless RUBY_ENGINE == "opal" location = $window.location protocol = location.scheme == "https:" ? "wss:" : "ws:" "#{protocol}//#{location.host}#{path}" end |
#socket_class ⇒ Object
49 50 51 52 53 |
# File 'lib/duoruby/socket/transport.rb', line 49 def socket_class raise "default socket transport is only available under Opal" unless RUBY_ENGINE == "opal" ::Browser::Socket end |