I have downloaded the LS version 7.1 and in LS server configuration I have set as Community edition. And I have created adapter as like I have used in enterprise edition.
I have started LS server everything is working in server. When I try to connect the client it showing the error as like
http://localhost:8080/lightstreamer/create_session.js: Request header field username is not allowed by Access-Control-Allow-Headers in preflight response.
And also I have tried by removing the user name field from connection parameter this also not working.
This always tying to connect the LS server from client.
I have used the below code to connect, And also in server I have mentioned the javascript_client.
define(["LightstreamerClient"],function(LightstreamerClient) {
var protocolToUse = document.location.protocol != "file:" ? document.location.protocol : "
http:";
var portToUse = document.location.protocol == "
https:" ? "443" : "8080";
var lsClient = new LightstreamerClient(protocolToUse+"//localhost:"+portToUse,"STOCKLISTDEMO_REMOTE");
lsClient.connectionOptions.setHttpExtraHeaders({"username" : "myusername"});
lsClient.connectionOptions.setHttpExtraHeadersOnSessionCreationOnly(true);
lsClient.connect();
return lsClient;
});