Skip to content

andreysaksonov/tcp-mocker

Repository files navigation

Travis Build Status Docker Image Version Docker Image Size

tcp-mocker

Build

Supported Java Versions:
Using Maven

./mvnw clean package

Using Docker

docker-compose up

Usage

Docker:
docker run -it --rm \
  -p 10001:10001 \
  -v $(pwd)/tcp-mappings:/var/lib/tcp-mocker/tcp-mappings \
  tcpmocker/tcp-mocker-app:LOCAL-SNAPSHOT

Tips & Tricks

TCP Mocker Ping-Pong Playground
$ docker run -it --rm \
    -p 10001:10001 \
    -v $(pwd)/tcp-mocker-app-test/tcp-mocker-app/tcp-mappings:/var/lib/tcp-mocker/tcp-mappings \
    tcpmocker/tcp-mocker-app:LOCAL-SNAPSHOT

$ echo -ne 'ping' | xxd -p
70696e67

$ echo -ne '\x70\x69\x6e\x67' | xxd -p
70696e67

$ echo -ne '\x70\x69\x6e\x67' | ncat localhost 10001
pong

$ echo -ne '\x70\x69\x6e\x67' | ncat localhost 10001 | xxd -p
706f6e67
Upgrade Maven Wrapper Version
mvn -N io.takari:maven:wrapper -Dmaven=3.6.3

About

TCP Mocker is a tool which simplifies testing on a network level. It can mock a TCP server by mapping request patterns to pre-defined responses.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published