direct websocket to PCI server Nutech

This commit is contained in:
2022-08-11 14:46:44 +07:00
parent 61c2e7f086
commit 2b93fbce4e
2 changed files with 21 additions and 11 deletions
@@ -6,14 +6,14 @@
"auditLog": ".71c131f2ce727b13210eef32232709400762e5fb-audit.json",
"files": [
{
"date": 1658895025434,
"name": "2022-07-27-onlinetopup.log",
"hash": "c42156dc1828aef26c15634e6e7b298696e24e0371d265e7db472a09f3b1da4a"
"date": 1660118902222,
"name": "2022-08-10-onlinetopup.log",
"hash": "f3452bb37273fa8d143fc72d0eb29cf38a01111c694585768cc9e22449acfb19"
},
{
"date": 1658975109023,
"name": "2022-07-28-onlinetopup.log",
"hash": "ff688ec2f8aeee014653b80877911239635fa446dae3cf382bd2a343fcace076"
"date": 1660153631005,
"name": "2022-08-11-onlinetopup.log",
"hash": "b04aaa1b43dcd1effc3a3b3d1fd0122fc3ab1e4dcfbfbe0fbc343412ab3ba877"
}
],
"hashType": "sha256"
+15 -5
View File
@@ -13,7 +13,8 @@ let options = {
passphrase: "GPqs+Uia78",
pfx: fs.readFileSync(ssl_client_pfx),
};
let url = "wss://gateway04.cyberware.co.jp/feliqserver/v1/wsapi";
// let url = "wss://gateway04.cyberware.co.jp/feliqserver/v1/wsapi"; // server jepang
let url = "ws://117.102.86.186/feliqserver/v1/wsapi"; // server nutech tetra
const config = {
timeout: 1000, //timeout connecting to each server, each try
@@ -148,14 +149,23 @@ class WebSocketClient {
authHead[1] = 0x9e;
// Set API key
//const apiKeyBytes = Buffer.from('82002732-9148-34e5-843b-c639a0c88cc5-0TC') // T4
// const apiKeyBytes = Buffer.from(
// "4c6dd075-dbcb-375f-81f7-62990a5d7000-0TC"
// ); // Nutech Server Jepang
// // Secret setting
// //const secretBytes = Buffer.from('TdtSo/i5ZmbwPr82gt4fElK96lV9ClVo7votHKMIUuo='); // T4
// const secretBytes = Buffer.from(
// "U5xs7nVonhtbQ+XiYATRSg8Nk5sPu1IpVx7X40KyWiw="
// ); // Nutech Server Jepang
const apiKeyBytes = Buffer.from(
"4c6dd075-dbcb-375f-81f7-62990a5d7000-0TC"
); // Nutech
"d54ff5c4-9709-3bac-9a6e-04b2f4deebae-0TC"
); // Nutech Server Nutech Tetra
// Secret setting
//const secretBytes = Buffer.from('TdtSo/i5ZmbwPr82gt4fElK96lV9ClVo7votHKMIUuo='); // T4
const secretBytes = Buffer.from(
"U5xs7nVonhtbQ+XiYATRSg8Nk5sPu1IpVx7X40KyWiw="
); // Nutech
"W8ZiN1o2tNkb1svNlj5Kl8PNohhujaTxeNaGEq2rOWY="
); // Nutech Server Nutech Tetra
const authData = Buffer.concat([authHead, apiKeyBytes, secretBytes]);