juks / iso-8583-socket-queue

ISO 8583 gateway
MIT License
194 stars 111 forks source link

Problem encode RAW packet [Length] #59

Closed hafedh-trimeche closed 4 years ago

hafedh-trimeche commented 4 years ago

I try to send 0800 command by generating this packet (Length included). The server seams that only accepts packets not including length header. 0048080002200000080000000511214416663881936400299162

Would please indicate me how to force server accept the packet's length?

Would also the packet be sent as Text or Binary or HEX format? Visa Base I uses HEX and EBCDIC to convert fields.

Config: { "dangerous":false, "echoServerPort":5000, "lengthIncludeHeader":false, "listenPort":8711, "logFile":"log.txt", "overrides":"1:bitmap-hex:8", "upstreamHost":"localhost", "upstreamPort":5000, "useHeader":true, "vv":true }


D:\Applications\iso-8583-socket-queue>node` socketQueue.js -c config.json 2020-05-11 22:48:51 - info: Important: starting... 2020-05-11 22:48:51 - info: Remote host configuration name: smartVista 2020-05-11 22:48:51 - info: Connecting to upstream server localhost:5000 2020-05-11 22:48:51 - info: Relay raw ISO-8583 server is now running on port 8711 2020-05-11 22:48:51 - info: Echo server is now running on port 5000 2020-05-11 22:48:51 - info: Connected to upstream 127.0.0.1:5000! 2020-05-11 22:48:51 - info: Processing queue [pending 0 / total 0] 2020-05-11 22:48:51 - info: The queue is empty 2020-05-11 22:48:57 - info: Client ::ffff:127.0.0.1:56126 connected 2020-05-11 22:49:00 - info: Client ::ffff:127.0.0.1:56126 sent data (52b) 2020-05-11 22:49:00 - verbose: [00480800...] Exception: Error unpacking data from bit 23 Packager: undefined: Unknown packager 23 Error: Unknown packager 23 at ISO8583._unpack (D:\Applications\iso-8583-socket-queue\lib\iso8583\lib\iso8583.js:23:28) at ISO8583.unpack (D:\Applications\iso-8583-socket-queue\lib\iso8583\lib\iso8583.js:88:23) at new Iso8583Packet (D:\Applications\iso-8583-socket-queue\lib\iso8583-packet\lib\iso8583Packet.js:45:37) at queue.addMessage (D:\Applications\iso-8583-socket-queue\lib\iso8583-queue\lib\iso8583Queue.js:50:11) at Upstream.sendData (D:\Applications\iso-8583-socket-queue\lib\socketServer\lib\upstream.js:77:24) at Socket. (D:\Applications\iso-8583-socket-queue\lib\socketServer\lib\clientSocket.js:47:21) at Socket.emit (events.js:310:20) at addChunk (_stream_readable.js:286:12) at readableAddChunk (_stream_readable.js:268:9) at Socket.Readable.push (_stream_readable.js:209:10) Exception: Error unpacking data from bit 27 Packager: undefined: Unknown packager 27 Error: Unknown packager 27 at ISO8583._unpack (D:\Applications\iso-8583-socket-queue\lib\iso8583\lib\iso8583.js:23:28) at ISO8583.unpack (D:\Applications\iso-8583-socket-queue\lib\iso8583\lib\iso8583.js:88:23) at new Iso8583Packet (D:\Applications\iso-8583-socket-queue\lib\iso8583-packet\lib\iso8583Packet.js:45:37) at queue.addMessage (D:\Applications\iso-8583-socket-queue\lib\iso8583-queue\lib\iso8583Queue.js:50:11) at Upstream.sendData (D:\Applications\iso-8583-socket-queue\lib\socketServer\lib\upstream.js:77:24) at Socket. (D:\Applications\iso-8583-socket-queue\lib\socketServer\lib\clientSocket.js:47:21) at Socket.emit (events.js:310:20) at addChunk (_stream_readable.js:286:12) at readableAddChunk (_stream_readable.js:268:9) at Socket.Readable.push (_stream_readable.js:209:10) Exception: Error unpacking data from bit 53 Packager: undefined: Unknown packager 53 Error: Unknown packager 53 at ISO8583._unpack (D:\Applications\iso-8583-socket-queue\lib\iso8583\lib\iso8583.js:23:28) at ISO8583.unpack (D:\Applications\iso-8583-socket-queue\lib\iso8583\lib\iso8583.js:88:23) at new Iso8583Packet (D:\Applications\iso-8583-socket-queue\lib\iso8583-packet\lib\iso8583Packet.js:45:37) at queue.addMessage (D:\Applications\iso-8583-socket-queue\lib\iso8583-queue\lib\iso8583Queue.js:50:11) at Upstream.sendData (D:\Applications\iso-8583-socket-queue\lib\socketServer\lib\upstream.js:77:24) at Socket. (D:\Applications\iso-8583-socket-queue\lib\socketServer\lib\clientSocket.js:47:21) at Socket.emit (events.js:310:20) at addChunk (_stream_readable.js:286:12) at readableAddChunk (_stream_readable.js:268:9) at Socket.Readable.push (_stream_readable.js:209:10) 2020-05-11 22:49:00 - verbose:

::ffff:127.0.0.1:56126

 Message Type Indicator [0].......................0048
 Bitmap [1].......................................0800022000000800
 Amount, Settlement [5]...........................5112144

================================================================================================

2020-05-11 22:49:00 - info: Writing to queue ::ffff:127.0.0.1:56126 [0] 2020-05-11 22:49:00 - info: New queue item 0 2020-05-11 22:49:00 - info: Processing queue [pending 1 / total 1] 2020-05-11 22:49:00 - verbose: Queue keys dump: 0 2020-05-11 22:49:00 - info: Upstreaming data for ::ffff:127.0.0.1:56126 2020-05-11 22:49:00 - verbose: [00520048...] 2020-05-11 22:49:00 - info: Echo server got data Exception: Error unpacking data from bit 23 Packager: undefined: Unknown packager 23 Error: Unknown packager 23 at ISO8583._unpack (D:\Applications\iso-8583-socket-queue\lib\iso8583\lib\iso8583.js:23:28) at ISO8583.unpack (D:\Applications\iso-8583-socket-queue\lib\iso8583\lib\iso8583.js:88:23) at new Iso8583Packet (D:\Applications\iso-8583-socket-queue\lib\iso8583-packet\lib\iso8583Packet.js:45:37) at Socket. (D:\Applications\iso-8583-socket-queue\lib\testSuite\lib\echoServer.js:38:17) at Socket.emit (events.js:310:20) at addChunk (_stream_readable.js:286:12) at readableAddChunk (_stream_readable.js:268:9) at Socket.Readable.push (_stream_readable.js:209:10) at TCP.onStreamRead (internal/stream_base_commons.js:186:23) Exception: Error unpacking data from bit 27 Packager: undefined: Unknown packager 27 Error: Unknown packager 27 at ISO8583._unpack (D:\Applications\iso-8583-socket-queue\lib\iso8583\lib\iso8583.js:23:28) at ISO8583.unpack (D:\Applications\iso-8583-socket-queue\lib\iso8583\lib\iso8583.js:88:23) at new Iso8583Packet (D:\Applications\iso-8583-socket-queue\lib\iso8583-packet\lib\iso8583Packet.js:45:37) at Socket. (D:\Applications\iso-8583-socket-queue\lib\testSuite\lib\echoServer.js:38:17) at Socket.emit (events.js:310:20) at addChunk (_stream_readable.js:286:12) at readableAddChunk (_stream_readable.js:268:9) at Socket.Readable.push (_stream_readable.js:209:10) at TCP.onStreamRead (internal/stream_base_commons.js:186:23) Exception: Error unpacking data from bit 53 Packager: undefined: Unknown packager 53 Error: Unknown packager 53 at ISO8583._unpack (D:\Applications\iso-8583-socket-queue\lib\iso8583\lib\iso8583.js:23:28) at ISO8583.unpack (D:\Applications\iso-8583-socket-queue\lib\iso8583\lib\iso8583.js:88:23) at new Iso8583Packet (D:\Applications\iso-8583-socket-queue\lib\iso8583-packet\lib\iso8583Packet.js:45:37) at Socket. (D:\Applications\iso-8583-socket-queue\lib\testSuite\lib\echoServer.js:38:17) at Socket.emit (events.js:310:20) at addChunk (_stream_readable.js:286:12) at readableAddChunk (_stream_readable.js:268:9) at Socket.Readable.push (_stream_readable.js:209:10) at TCP.onStreamRead (internal/stream_base_commons.js:186:23) 2020-05-11 22:49:00 - info: Replying to client null

juks commented 4 years ago

Hi, Hafedh!

It works with the length header only between hosts. So it doesn't read the header sent by a client side.