juks / iso-8583-socket-queue

ISO 8583 gateway
MIT License
194 stars 111 forks source link

How to run sv_*_header.txt samples #56

Closed samnemo94 closed 4 years ago

samnemo94 commented 4 years ago

What is the configuration to run SocketQueue with, so that it accepts the samples with headers?

juks commented 4 years ago

Hi!

SocketQueue uses headers for upstream connection only. It does not read headers sent by clients. By default the length header is present.

Below is the example of self test mode where a binary client sends an echo packet that is being passed to an upstream with the length header. The response also comes with the header. The header data is marked with bold.

$ node socketQueue.js --upstreamHost=localhost --upstreamPort=5000 --listenPort=2014 --listenHttpPort=8080 --vv --echoServerPort=5000 --testClients=1 --testTargetHost=127.0.0.1 --testTargetPort=2014 2020-04-07 22:49:08 - info: Important: starting...
2020-04-07 22:49:08 - info: Remote host configuration name: smartVista
2020-04-07 22:49:08 - info: Connecting to upstream server localhost:5000
2020-04-07 22:49:08 - info: Relay raw ISO-8583 server is now running on port 2014
2020-04-07 22:49:08 - info: Relay HTTP server is now running on port 8080
2020-04-07 22:49:08 - info: Echo server is now running on port 5000
2020-04-07 22:49:08 - info: Connected to upstream 127.0.0.1:5000!
2020-04-07 22:49:08 - info: Processing queue [pending 0 / total 0]
2020-04-07 22:49:08 - info: The queue is empty
2020-04-07 22:49:09 - info: Client ::ffff:127.0.0.1:55314 connected
2020-04-07 22:49:09 - info: Client ::ffff:127.0.0.1:55314 sent data (45b)
2020-04-07 22:49:09 - verbose: [0800.......]
2020-04-07 22:49:10 - verbose:

::ffff:127.0.0.1:55314

 [Echo Request]

 Message Type Indicator [0].......................0800
 Bitmap [1].......................................2220010000800000
 Processing Code [3]..............................990000
 Transmission Date and Time [7]...................0407224909
 System Trace Audit Number [11]...................000001
 Function Code [24]...............................831
 Card Acceptor Terminal Identification [41].......00000001

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

2020-04-07 22:49:10 - info: Writing to queue ::ffff:127.0.0.1:55314 [0]
2020-04-07 22:49:10 - info: New queue item 0
2020-04-07 22:49:10 - info: Processing queue [pending 1 / total 1]
2020-04-07 22:49:10 - verbose: Queue keys dump: 0
2020-04-07 22:49:10 - info: Upstreaming data for ::ffff:127.0.0.1:55314
2020-04-07 22:49:10 - verbose: [00450800...]
2020-04-07 22:49:10 - info: Echo server got data
2020-04-07 22:49:10 - info: Replying to client 00000001
2020-04-07 22:49:10 - info: Echo server sent response
2020-04-07 22:49:10 - info: Got data from ISO-host (61b)
2020-04-07 22:49:10 - verbose: [00570810...]
2020-04-07 22:49:10 - verbose: Releasing terminal 00000001 with the key 0

samnemo94 commented 4 years ago

Thank you for providing a sample log for it.