Reputation: 1407
I am looking for a software to mock a tcp/ip server. What I need is an easy to use tool (might cost something) which I can use to act as a server and where I can define a protocol flow with some constrains, for example executing the following flow:
Is there someone who can give me a hint? I am looking for ready to use software, not a library etc. It might be for Linux or Windows systems.
Thank you very much,
Maciej
Upvotes: 2
Views: 3372
Reputation: 2205
A simple solution is to use expect and tcpserver. The later comes with the ucspi-tcp package in Ubuntu and hopefully other debians.
Example:
Run this on one console:
$ tcpserver localhost 3333 expect -c 'expect "hello" ; send "hi\n" ; expect "bye" ; send "see you\n"'
And this on another:
$ telnet localhost 3333
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
hello
hi
bye
see you
Connection closed by foreign host.
Upvotes: 7