wsock
wsock copied to clipboard
Add support for cookie based authentication in the initial handshake
Add a new function open/4, which is open/3 with a forth parameter, which becomes an additional header - Cookie. Assume this authentication cookie was obtained in a previous step using a http auth mechanism.
My usage scenario is using ibrowse to do the http authentication step in the following manner:
Answer = ibrowse:send_req(Url, Headers, post, Body, Options),
case Answer of
{ok, Status, ResponseHeaders, _ResponseBody} ->
Cookies = get_cookies(ResponseHeaders),
AuthCookie = find_cookie(AuthCookiePattern, Cookies),
{ok, AuthCookie}
%...
end
HandshakeRequest = wsock_handshake:open(Resource, Url, Port, AuthCookie)
@ctradu in any case I'll take a look to the cookie thing (even if it's to late for you)