X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/da1614ac6d9b1b2aeba6267b304ce70c1726b608..c6378b0e7da030652334366c8459ff3853811529:/services/api/config/initializers/eventbus.rb diff --git a/services/api/config/initializers/eventbus.rb b/services/api/config/initializers/eventbus.rb index 2d2b7bc7af..4a6141ccf3 100644 --- a/services/api/config/initializers/eventbus.rb +++ b/services/api/config/initializers/eventbus.rb @@ -1,7 +1,16 @@ require 'eventbus' +# See application.yml for details about configuring the websocket service. + Server::Application.configure do + # Enables websockets if ARVADOS_WEBSOCKETS is defined with any value. If + # ARVADOS_WEBSOCKETS=ws-only, server will only accept websocket connections + # and return an error response for all other requests. if ENV['ARVADOS_WEBSOCKETS'] - config.middleware.insert_after ArvadosApiToken, RackSocket, {:handler => EventBus, :websocket_only => true } + config.middleware.insert_after ArvadosApiToken, RackSocket, { + :handler => EventBus, + :mount => "/websocket", + :websocket_only => (ENV['ARVADOS_WEBSOCKETS'] == "ws-only") + } end end