{"id":15641585,"url":"https://github.com/emicklei/zazkia","last_synced_at":"2025-04-07T18:13:35.970Z","repository":{"id":11393918,"uuid":"69533872","full_name":"emicklei/zazkia","owner":"emicklei","description":"tcp proxy to simulate connection problems","archived":false,"fork":false,"pushed_at":"2024-12-06T12:56:37.000Z","size":2490,"stargazers_count":75,"open_issues_count":1,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T16:14:36.982Z","etag":null,"topics":["proxy-server","tcp","test-automation","testing-tools"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emicklei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-29T05:29:17.000Z","updated_at":"2025-01-17T06:28:34.000Z","dependencies_parsed_at":"2024-06-03T18:48:02.534Z","dependency_job_id":"06bd8c9e-9d54-4c18-998d-dde260962156","html_url":"https://github.com/emicklei/zazkia","commit_stats":{"total_commits":84,"total_committers":6,"mean_commits":14.0,"dds":0.3214285714285714,"last_synced_commit":"d97af55eb15fa4e7b185d9d67f5723781eb9b3c3"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emicklei%2Fzazkia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emicklei%2Fzazkia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emicklei%2Fzazkia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emicklei%2Fzazkia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emicklei","download_url":"https://codeload.github.com/emicklei/zazkia/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247704571,"owners_count":20982298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["proxy-server","tcp","test-automation","testing-tools"],"created_at":"2024-10-03T11:43:14.360Z","updated_at":"2025-04-07T18:13:35.930Z","avatar_url":"https://github.com/emicklei.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e zazkia\nis a tool that simulates all kinds of connection problems with a tcp connection (reset,delay,throttle,corrupt).\n\n![systemtest dashboard](./systemtest/systemtest.png)\n\n\n### How does it work ?\nIn order to apply misbehavior, zazkia must be used as a proxy between a client and service.\nIt will accept tcp connections from a client and for each new one, will create a connection to the target service.\n\n![](dashboard/img/zazkia-as-proxy.png)\n\n### Routes\nBy specifying routes, you can tell zazkia on what ports to listen and what target to connect to (host and port).\n\nMinimal zazkia-routes.json example\n\n\t[\n\t    {\n\t        \"label\": \"oracle\",\n\t        \"service-hostname\": \"some.host.name\",\n\t        \"service-port\": 1521,\n\t        \"listen-port\": 49997\n\t    }\n\t]\n\nWith this route definition, your application should use \"localhost:49997\" instead of \"some.host.name:1521\" in the connection specification.\nYour application (the client) will setup a tcp connection with zazkia which will setup another tcp connection to oracle (the service).\n\n#### Initial transport behavior\nThe transport part of a route configuration can be used to setup the initial behavior of a new connection pair (called link).\nUsing a REST api, the transport behavior can be changed on a per-link basis.\n\nFull zazkia-routes.json example\n\n\t[\n\t    {\n\t        \"label\": \"postgresql\",\n\t        \"service-hostname\": \"some.other.host.name\",\n\t        \"service-port\": 5432,\n\t        \"listen-port\": 49998,\n\t        \"transport\": {\n\t\t\t\t\"accept-connections\": true,\n\t\t\t\t\"throttle-service-response\": 1000,\n\t\t\t\t\"delay-service-response\": 100,\n\t\t\t\t\"break-service-response\": 10,\n\t\t\t\t\"service-response-corrupt-method\": \"randomize\",\n\t\t\t\t\"sending-to-client\": true,\n\t\t\t\t\"receiving-from-client\": true,\n\t\t\t\t\"sending-to-service\": true,\n\t\t\t\t\"receiving-from-service\": true,\n\t\t\t\t\"verbose\": true\n\t        }\n\t    }\n\t]\n\n| transport property | comment | effective values |\n|-----------|---------|--------|\n| accept-connections | whether connections from the client are accepted | true, false |\n| throttle-service-response | bytes per second | non-negative integer |\n| delay-service-response | milliseconds delay | non-negative integer |\n| break-service-response | percentage of broken connections | integer between 0 and 100 |\n| service-response-corrupt-method | how the bytes are mangled | **empty**, randomize |\n| sending-to-client | whether a response from the service is sent back to the client | true, false |\n| receiving-from-client | whether a request from the client is read | true, false |\n| sending-to-service | whether a request from the client is sent to the service | true, false|\n| receiving-from-service | whether a response from the service is read | true, false | \n| verbose | log each message that is transported between client and service | true, false |\n\n### Default transport behavior \n\n\t\"transport\": {\n\t\t\"accept-connections\": true,\n\t\t\"throttle-service-response\": 0,\n\t\t\"delay-service-response\": 0,\n\t\t\"break-service-response\": 0,\n\t\t\"service-response-corrupt-method\": \"\",\n\t\t\"sending-to-client\": true,\n\t\t\"receiving-from-client\": true,\n\t\t\"sending-to-service\": true,\n\t\t\"receiving-from-service\": true,\n\t\t\"verbose\": false\n\t}\n\n### Build\n\n\tgo test\n\tgo build\n\n## Run\n\n### Usage\n\n    ./zazkia  -h\n    2021/03/26 14:38:06 zazkia - tpc proxy for simulating network problems\n    Usage of ./zazkia:\n      -f string\n            route definition (default \"zazkia-routes.json\")\n      -p int\n            port on which the admin http server will listen (default 9191)\n      -v    verbose logging\n\nDefaults (-p 9191 -f zazkia-routes.json)\n\n\t./zazkia\n\n### Dashboard\nA simple HTML dashboard is available to change the transport behavior of individual links. See the Swagger tab for documentation of the REST API.\n\n\thttp://localhost:9191\n\n## Docker\nA Docker image is available on Docker Hub.\n\n### Usage\n\n\tdocker run -d -p 9200-9300:9200-9300 -p 9191:9191 -v $(pwd):/data emicklei/zazkia\n\nZazkia will look for a file called **zazkia-routes.json**.\nThe web UI will be running on http://localhost:9191\nWhen using Docker, routes must use listener ports in the range 9200-9300 or 3306 (mysql) or 5432 (postgres) or 8080 (tomcat,jboss).\n\n### Examples\n\nSee the examples folder for simple usecase examples.\n\n### Build your own image\n\n\tGOOS=linux go build \u0026\u0026 docker build -t emicklei/zazkia:latest .\n\n\n© 2024, [ernestmicklei.com](http://ernestmicklei.com).  Apache v2 License. Contributions welcome.\t\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femicklei%2Fzazkia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femicklei%2Fzazkia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femicklei%2Fzazkia/lists"}