Skip to content

Commit 06eff31

Browse files
committed
predisposition for the default SSL port
1 parent 5afc4d9 commit 06eff31

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ You can deploy this demo in order to use the Lightstreamer server as Web server
3535
If you choose the former case please note that in the <LS_HOME>/pages/demos/ folder there is a copy of the /src directory of this project, if this is non your case please create the folders <LS_HOME>/pages/demos/MessengerDemo then copy here the contents of the /src folder of this project.<br>
3636
The client demo configuration assumes that Lightstreamer Server, Lightstreamer Adapters and this client are launched on the same machine. If you need to targeting a different Lightstreamer server please search this line:
3737
```js
38-
var lsClient = new LightstreamerClient(protocolToUse+"//localhost:8080","MESSENGER");
38+
var lsClient = new LightstreamerClient(protocolToUse+"//localhost:"+portToUse,"MESSENGER");
3939
```
4040
in js/lsClient.js file and change it accordingly.<br>
4141
Anyway the [SIMPLE_MESSENGER](https://github.com/Weswit/Lightstreamer-example-Messenger-adapter-java) and [IMMetadataAdapter](https://github.com/Weswit/Lightstreamer-example-Messenger-adapter-java) Adapters have to be deployed in your local Lightstreamer server instance. The factory configuration of Lightstreamer server already provides this adapter deployed.<br>

src/js/lsClient.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
//////////////// Connect to current host (or localhost) and configure a StatusWidget
1818
define(["LightstreamerClient","StatusWidget"],function(LightstreamerClient,StatusWidget) {
1919
var protocolToUse = document.location.protocol != "file:" ? document.location.protocol : "http:";
20-
var lsClient = new LightstreamerClient(protocolToUse+"//localhost:8080","MESSENGER");
20+
var portToUse = document.location.protocol == "https:" ? "443" : "8080";
21+
// in accordance with the port configuration in the factory lightstreamer_conf.xml
22+
// (although the https port is not open by the factory lightstreamer_conf.xml)
23+
24+
var lsClient = new LightstreamerClient(protocolToUse+"//localhost:"+portToUse,"MESSENGER");
2125

2226
lsClient.connectionSharing.enableSharing("MessengerDemoCommonConnection", "ATTACH", "CREATE");
2327
lsClient.addListener(new StatusWidget("left", "0px", true));

0 commit comments

Comments
 (0)