[99s-extend] help to combine websocket with basic authentication

e at bestmx.net e at bestmx.net
Mon Jul 13 13:01:53 CEST 2015


> Now I would like to add a
> basic authentication, and I saw, there is an example how to do this. I
> checked the cowboy/examples/rest_basic_auth example.

may i ask?
why do you want "basic"
while using WS, which keeps state implicitly.

"basic" is a CRUTCH for stateless environments,
but you have cowboy that naturally passes the "State" variable trough 
handlers.

also, do you remember that "basic" gives you no option to logout?


> So I tried "add" the aut. example into my websocket app by doing the
> following steps:
>   - add new module for handle the authentication
>     do_basic_auth.erl
>   - update cowboy_router:compile function call when star application with
> {"/", do_basic_auth, []}
>
> Once the compilation done, I can start the app and I get the "basic auth"
> window in the browser when connecting to localhost:8080, but the "ordinary"
> index.html does not appears when I set the correct auth data (user/pwd). I
> am pretty sure that I made something wrong, I do not see what I did wrong,
> thus I kindly ask you, please try help me.
>
> The project what I am working on can be seen in the github:
>     https://github.com/ethrbh/websocket_2
>
> thanks fro your help,
> /Robi
>
>
>
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> https://lists.ninenines.eu/listinfo/extend
>


More information about the Extend mailing list