Reputation: 3045
I'm using Cro HTTP Authentication/Authorization/Sessions very successfully with HTTP routes.
Then I added a route that creates a web-socket
using Cro::HTTP::Router::WebSocket
, and I can connect to it with Cro::WebSocket::Client
and everything works fine.
Now I want to control access to the websocket, so I add a Cro::HTTP::Auth
parameter. Works great. Now the the client gets a 401 Unauthorized
as expected.
Next step, how do I open the door?
With Cro::HTTP::Client
, I can pass in an Authorization
header, or even pass in the auth
option. How do I do that with Cro::WebSocket::Client
?
I'm very new to WebSocket, so I don't even know if this is the right way to do things like this, but it seems like the Cro::WebSocket::Client
connect
method should take a headers
named option that gets extra headers that get passed along.
Upvotes: 11
Views: 278