diff --git a/README.md b/README.md index 86a06de..064a675 100644 --- a/README.md +++ b/README.md @@ -41,8 +41,12 @@ Give this option to print all the data to the console. `--streamr-url [url]` -The Streamr websocket API URL, for example `wss://www.streamr.com/api/v1/ws`. If not defined, -the default value in the Streamr client library is used. +The Streamr websocket API URL. By default, uses the default value in the Streamr JS SDK (`wss://www.streamr.com/api/v1/ws`). + +`--streamr-rest-url [url]` + +The Streamr REST API URL. By default, uses the default value in the Streamr JS SDK (`https://www.streamr.com/api/v1`). + `--public` @@ -101,4 +105,4 @@ AGPLv3, see [LICENSE](LICENSE). ## TODO -- Utility for the other direction (Streamr to MQTT) \ No newline at end of file +- Utility for the other direction (Streamr to MQTT) diff --git a/bin/mqtt-streamr.js b/bin/mqtt-streamr.js index fe133a2..309fd5b 100755 --- a/bin/mqtt-streamr.js +++ b/bin/mqtt-streamr.js @@ -34,7 +34,11 @@ const options = require('yargs') }) .option('streamr-url', { default: undefined, - describe: 'The Streamr websocket API URL, for example wss://www.streamr.com/api/v1/ws', + describe: 'The Streamr websocket API URL. By default, uses the default value in the Streamr JS SDK (wss://www.streamr.com/api/v1/ws)', + }) + .option('streamr-rest-url', { + default: undefined, + describe: 'The Streamr REST API URL. By default, uses the default value in the Streamr JS SDK (https://www.streamr.com/api/v1)', }) .option('public', { type: 'boolean', @@ -84,6 +88,9 @@ const clientConfig = {} if (options['streamr-url']) { clientConfig.url = options['streamr-url'] } +if (options['streamr-url']) { + clientConfig.restUrl = options['streamr-rest-url'] +} if (options['api-key']) { clientConfig.auth = { @@ -226,4 +233,4 @@ const connectMqttClient = () => { }) } -connectMqttClient() \ No newline at end of file +connectMqttClient()