
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
lightstreamer-adapter
Advanced tools
This package includes the resources needed to write Data Adapters and Metadata Adapters for Lightstreamer Server in a node environment. The adapters will run in a separate process, communicating with the Server through the Adapter Remoting Infrastructure.
This package includes the resources needed to write Data Adapters and Metadata Adapters for Lightstreamer Server in a Node.js environment. The adapters will run in a separate process, communicating with the Server through the Adapter Remoting Infrastructure.
Install the package using npm
npm install lightstreamer-adapter
<?xml version="1.0"?>
<adapters_conf id="PROXY_NODE">
<metadata_provider>
<adapter_class>com.lightstreamer.adapters.remote.metadata.RobustNetworkedMetadataProvider</adapter_class>
<param name="request_reply_port">8003</param>
<param name="timeout">36000000</param>
</metadata_provider>
<data_provider>
<adapter_class>com.lightstreamer.adapters.remote.data.RobustNetworkedDataProvider</adapter_class>
<param name="request_reply_port">8001</param>
<param name="notify_port">8002</param>
<param name="timeout">36000000</param>
</data_provider>
</adapters_conf>
Create a .js file, let's call it "adapters.js"
var net = require('net'),
reqRespStream = net.createConnection(8001, LIGHTSTREAMER_SERVER_HOST),
notifyStream = net.createConnection(8002, LIGHTSTREAMER_SERVER_HOST),
metadataStream = net.createConnection(8003, LIGHTSTREAMER_SERVER_HOST);
var MetadataProvider = require('lightstreamer-adapter').MetadataProvider,
DataProvider = require('lightstreamer-adapter').DataProvider,
dataProvider = new DataProvider(reqRespStream, notifyStream),
metadataProvider = new MetadataProvider(metadataStream);
dataProvider.on('subscribe', function(itemName, response) {
//HERE start sending updates for the itemName item
response.success();
});
dataProvider.on('unsubscribe', function(itemName, response) {
//HERE stop sending updates for the itemName item
response.success();
});
metadataProvider.on('notifyUserMessage', function(request, response) {
//HERE handle user message
response.success();
});
dataProvider.update(itemName, false, {
'field1': valField1,
'field2': valField2
});
From the command line call
node adapters.js
var lsClient = new LightstreamerClient(LIGHTSTREAMER_SERVER_HOST,"PROXY_NODE");
lsClient.connect();
note that the "PROXY_NODE" string is taken from the adapters.xml
At the time of writing API docs are not deployed anywhere so you have to generate it yourself (see below how to do so). We will deploy them somewhere online at some point.
This section is dedicated to developers who want to extend/modify the library itself, if you're simply looking to use it, ignore it.
We want to write code to use our package by requiring "lightstreamer-adapter" without having to specify the full path. On the other hand during development we do not want to install the package from the repo as we want in fact test it before put it on the repo for everyone else to enjoy. So:
npm link
npm link lightstreamer-adapter
NOTE: you can't globally link the package (using -g) to make it available everywhere
First install nodeunit
npm -g install nodeunit
the -g unit will install it on the system instead of installing it locally, you may remove it if you prefer a local installation
Go to the test folder and run the following commands
nodeunit dataprotocol.test.js
nodeunit dataprovider.test.js
nodeunit metadataprotocol.test.js
nodeunit metadataprovider.test.js
jsdoc --recurse --destination docs lib
The API documentation will be available in the docs folder.
Compatible with Adapter Remoting Infrastructure since 1.4.3
FAQs
This package includes the resources needed to write Data Adapters and Metadata Adapters for Lightstreamer Server in a Node.js environment. The adapters will run in a separate process, communicating with the Server through the Adapter Remoting Infrastructu
The npm package lightstreamer-adapter receives a total of 25 weekly downloads. As such, lightstreamer-adapter popularity was classified as not popular.
We found that lightstreamer-adapter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.