This project is read-only.

Custom Header to Atmosphere Framework

Jul 16, 2014 at 4:33 PM

I'm trying to connect WebSocket4Net client to a Tomcat server running Atmosphere Framework, it works but now I try to create e connection with custom header for basic authentication. I followed a previous post and I got this:

List<KeyValuePair<String, String>> list_customHeaderItems = new List<KeyValuePair<string, string>>();
        String userName = "user";
        String userPassword = "pw";
        string authInfo = userName + ":" + userPassword;
        authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));

        list_customHeaderItems.Add(new KeyValuePair<string, string>("Authorization", "Basic " + authInfo));

        websocket = new WebSocket("ws://localhost:8080/testServer/pubsub/client", "", null, list_customHeaderItems, "", "", WebSocketVersion.Rfc6455);

I can establish the connection but I can't get the header in Atmosphere:

webSocket.resource().getRequest().getHeader("Authorization") returns null.

Someone could help me?
Jul 17, 2014 at 10:19 AM
Probably you can enable .Net socket trace to check whether the client send the customized header.