-
January 27th, 2014, 06:32 PM
#1
Generic C client over HTTP
I have a legitimic access to a LS server through a paid account. However, the only access it provides is through a browser.
I am developing my own C client emulating the HTTP protocol, and following to some extent the (very) obfuscated LS code.
I'm stuck when I try to access "/lightstreamer/ajax_frame.html?phase=###", which from the source I've deducted that ### is a random number <1000.
Could you please guide me on the real meaning of this number or any reason I get a 404 error? Are there any requisites (like logging in to the main server, which I've done already), or like sending this ### anywhere else before getting the ajax_frame?
So far I have wireshark'd the communication and run a phantomjs client (which incidentally, doesn't get the stream either), and in neither case have been able to figure out the significance of this number.
And maybe, a simpler question would be: what does "end(41)" mean as a response from the server? I get that after "/lightstreamer/STREAMING_IN_PROGRESS?LS_session=", and I don't see it documented.
Regards.
Alfredo Meraz
Last edited by alfredomeraz; January 27th, 2014 at 09:04 PM.
Reason: maybe problem is more related with end(41)
-
January 28th, 2014, 08:43 AM
#2
Hi Alfredo,
In order to develop your custom generic client you should implement the Network Protocol for Generic Client. In the linked document you can find the full documentation of an HTTP-based network protocol necessary to connect to Lightstreamer by a generic application.
The Lightstreamer JavaScript library, indeed, uses a quite different protocol, reserved and undocumented. For this reason it will not be of great help to you sniff a JS client.
Furthermore, note also that the Generic Client API should be enabled server side, so please check if the Lighstreamer server you are targetting has this option turned up.
-
January 29th, 2014, 06:23 AM
#3
Hi Giuseppe:
First of all, thanks a lot for your prompt answer and for putting me back on my own track. I had lost sight that I'd been trying to kill 2 birds with one stone, when I only needed one ASAP for eating.
Indeed, the server I need to interact with right away is a Presto Edition. In a few more months, I'll get into a contest that in the edition 2 years ago was running an allegro edition with JS API only, and that was the reason I put aside the document you linked.
Today I implemented the TCP protocol outlined in the document (quite easy BTW), but I run into an error (again) that I can't find a concise explanation for (other that my first guess): no matter how I adjust the parameters for control.txt I keep getting the error "501 Not Implemented", which if I'm taking correctly, it means that no metadata adapter is implemented to handle the TCP protocol directly... is this correct? Am I left back again dealing with the JS protocol? My doubt comes from the fact that I can do create_session.txt and bind_session.txt correctly, but my guess is that those options work because they come from the LS server only, whereas control.txt needs verification from the metadata server.
Regards.
Alfredo Meraz
-
January 29th, 2014, 09:18 AM
#4
Hi Alfredo,
Indeed, the "501, Not Implemented" reject should be issued by the Lightstreamer server without involving the Adapters.
There are a few cases that can result in that error and all involve a syntax error or a badly-formatted value in the HTTP protocol. For example, the use of an unexpected method, or if you specify a "Transfer-Encoding" when using 1.0 version.
Please verify that your control request, from the point of view of HTTP protocol, contains no errors or differences compared with the create and bind requests.
Furthermore, if you could have the server log, setting the INFO level to "LightstreamerLogger.connections" logger, you should find a more precise indication about the type of the error.
Hope that helps.
Tags for this Thread
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 03:46 AM.
Bookmarks