Class: Rage::Configuration::Cable
- Inherits:
-
Object
- Object
- Rage::Configuration::Cable
- Defined in:
- lib/rage/configuration.rb
Instance Attribute Summary collapse
-
#allowed_request_origins ⇒ Array<Regexp>, ...
Restrict the server to only accept requests from specified origins.
-
#disable_request_forgery_protection ⇒ Boolean
Disable request forgery protection for WebSocket connections to allow requests from any origin.
Instance Method Summary collapse
-
#protocol ⇒ Class
Returns the protocol the server will use.
-
#protocol=(protocol) ⇒ Object
Specify the protocol the server will use.
Instance Attribute Details
#allowed_request_origins ⇒ Array<Regexp>, ...
Restrict the server to only accept requests from specified origins. The origins can be strings or regular expressions. Defaults to /localhost/ in development and test environments.
582 583 584 |
# File 'lib/rage/configuration.rb', line 582 def allowed_request_origins @allowed_request_origins end |
#disable_request_forgery_protection ⇒ Boolean
Disable request forgery protection for WebSocket connections to allow requests from any origin.
582 |
# File 'lib/rage/configuration.rb', line 582 attr_accessor :allowed_request_origins, :disable_request_forgery_protection |
Instance Method Details
#protocol ⇒ Class
Returns the protocol the server will use.
594 595 596 |
# File 'lib/rage/configuration.rb', line 594 def protocol @protocol end |
#protocol=(protocol) ⇒ Object
Specify the protocol the server will use. Supported values include :actioncable_v1_json and :raw_websocket_json. Defaults to :actioncable_v1_json.
608 609 610 611 612 613 614 615 616 617 618 619 |
# File 'lib/rage/configuration.rb', line 608 def protocol=(protocol) @protocol = case protocol when Class protocol when :actioncable_v1_json Rage::Cable::Protocols::ActioncableV1Json when :raw_websocket_json Rage::Cable::Protocols::RawWebSocketJson else raise ArgumentError, "Unknown protocol. Supported values are `:actioncable_v1_json` and `:raw_websocket_json`." end end |