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.
479 480 481 |
# File 'lib/rage/configuration.rb', line 479 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.
479 |
# File 'lib/rage/configuration.rb', line 479 attr_accessor :allowed_request_origins, :disable_request_forgery_protection |
Instance Method Details
#protocol ⇒ Class
Returns the protocol the server will use.
491 492 493 |
# File 'lib/rage/configuration.rb', line 491 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.
505 506 507 508 509 510 511 512 513 514 515 516 |
# File 'lib/rage/configuration.rb', line 505 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 |