Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Mar 2011
    Location
    Boston
    Posts
    2

    Adding a http Header to a client connection

    Hi,

    I want to run a quick test where I pass information from the client to the LS engine which can be used in the notifyUser method of my MetaDataAdapter. I assume I should add a httpHeader to do this but unfortunately my javascript knowledge is minimal so I'm not sure how.

    Thanks

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    hi,

    you can't add http headers to requests to the Lightstreamer server made through our library. Btw this is not needed to send messages to the server.

    Check the sources of the ChatDemo, this is the code that sends messages to the server (an that are received by the notifyUserMessage)



    check the API docs of sendMessage for details on its input parameters

    HTH

  3. #3
    Member
    Join Date
    Mar 2011
    Location
    Boston
    Posts
    2
    Thanks,

    What I want to do is to add a cookie to the initial request to LS so it can be used in the notifyUser method for authentication. From what I can tell sendMessage can only be used once the engine has been created.

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,090
    I confirm that, if your extra information is required by the authentication process, then you cannot use sendMessage.

    In general, we don't suggest using cookies for authentication purposes, because they are not under the full control of the application.
    As an alternative, any extra information could, for instance, be passed by decorating the user name in such a way that notifyUser can identify and separate the various parts.

    That said, you can pass information by setting cookies. The httpHeaders parameter in notifyUser will include a "cookie" entry, whose value will include your cookie together with other ones (Lightstreamer may set its own cookies).
    Note that, if you want that cookies set by a page supplied by your Web Server are forwarded to Lightstreamer Server, you have to enlarge their domain restrictions.

  5. #5
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,090
    I had to fix my previous post.
    You will find a "cookie" entry in httpHeaders, as header names (which are case insensitive) are always reported in lower-case form.

 

 

Similar Threads

  1. Viewing IP supplied in HTTP header
    By johnffoley in forum Client SDKs
    Replies: 1
    Last Post: November 21st, 2011, 10:59 AM
  2. Silverlight Client Connection problem in IE
    By kkrisjoy in forum Client SDKs
    Replies: 7
    Last Post: December 17th, 2010, 10:30 AM
  3. Replies: 4
    Last Post: February 5th, 2009, 12:45 AM
  4. Replies: 0
    Last Post: January 10th, 2007, 05:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 09:41 PM.