-
August 17th, 2011, 08:40 PM
#1
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
-
August 18th, 2011, 09:57 AM
#2
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
-
August 23rd, 2011, 06:08 PM
#3
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.
-
August 24th, 2011, 09:01 AM
#4
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.
-
August 24th, 2011, 10:31 AM
#5
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
-
By johnffoley in forum Client SDKs
Replies: 1
Last Post: November 21st, 2011, 09:59 AM
-
By kkrisjoy in forum Client SDKs
Replies: 7
Last Post: December 17th, 2010, 09:30 AM
-
By jsharpe in forum Client SDKs
Replies: 4
Last Post: February 4th, 2009, 11:45 PM
-
By jsharpe in forum Adapter SDKs
Replies: 0
Last Post: January 10th, 2007, 04:03 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 10:06 AM.
Bookmarks