Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15589

Can someone help convert this nodejs code

$
0
0
This is in the documentation to connect with socket data in nodejs

And I am not good at api programming

var request = require("request");
var socketIoClient = require("socket.io-client");
let userID = "user1";
let password = "Abc@123";
let publicKey = "f5c57c8071b08536";
let publishFormat = "JSON";
let broadcastFormat = "Full";
let url = "http://192.168.1.163:3000";
var data = {
"userID": "user-id",
"password": "your-password",
"publicKey": "your-public-key",
"source": "WEB"
};
request.post({
url: url + "/auth/login",
json: true,
headers: {
'Content-Type': 'application/json',
'Content-Length': data.length
},
body: data
}, function (err, res, body) {
if (body.type == "success") {
if (body.result.token) {
var token = body.result.token;
var socket = socketIoClient(url, {
path: '/marketdata/socket.io',
query: {
token: "token",
userID: "userID",
source: "WEB",
publishFormat: "JSON",
broadcastMode: "Full"
}
});
socket.on('connect', function () {});
} else {
console.log(body.description);
}
});

Can someone help me convert this into vb.net please....

Viewing all articles
Browse latest Browse all 15589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>