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.
487 488 489 |
# File 'lib/rage/configuration.rb', line 487 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.
487 |
# File 'lib/rage/configuration.rb', line 487 attr_accessor :allowed_request_origins, :disable_request_forgery_protection |
Instance Method Details
#protocol ⇒ Class
Returns the protocol the server will use.
499 500 501 |
# File 'lib/rage/configuration.rb', line 499 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.
513 514 515 516 517 518 519 520 521 522 523 524 |
# File 'lib/rage/configuration.rb', line 513 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 |