{"id":24408830,"url":"https://github.com/sitano/tiproxy","last_synced_at":"2026-04-24T11:04:58.960Z","repository":{"id":145696497,"uuid":"285825059","full_name":"sitano/tiproxy","owner":"sitano","description":"Inetd-like proxy for a single process","archived":false,"fork":false,"pushed_at":"2020-08-14T13:55:08.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-01T09:11:00.527Z","etag":null,"topics":["inetd","proxy-server"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sitano.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-08-07T12:34:45.000Z","updated_at":"2020-08-14T13:55:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"e80bb243-6960-4255-82c3-359a927d30c5","html_url":"https://github.com/sitano/tiproxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sitano/tiproxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitano%2Ftiproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitano%2Ftiproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitano%2Ftiproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitano%2Ftiproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sitano","download_url":"https://codeload.github.com/sitano/tiproxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitano%2Ftiproxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32220295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T10:26:35.452Z","status":"ssl_error","status_checked_at":"2026-04-24T10:25:27.643Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["inetd","proxy-server"],"created_at":"2025-01-20T05:52:58.321Z","updated_at":"2026-04-24T11:04:58.929Z","avatar_url":"https://github.com/sitano.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tiproxy\n\nProxy accepts connections and translates them into\nthe child process. It maintains a single child process\nwhen there are active incoming connections.\n\n### Quick start\n\n#### curl+ncat\n\n    $ go build \n    $ ./tiproxy --dest 127.0.0.1:3000 --exec ncat --workdir /usr/sbin -- -l -k -p 3000 -4 -v\n    $ curl -v http://127.0.0.1:4000/api\n    \n#### broker-ncat+nc\n\n    $ go build \n    $ ./tiproxy --dest 127.0.0.1:3000 --exec ncat --workdir /usr/sbin -- -l -k -p 3000 -4 -v --broker\n    terminal X: $ nc -t 127.0.0.1 4000\n    terminal Y: $ echo HELLO | nc -t 127.0.0.1 4000\n    terminal Z: $ telnet 127.0.0.1 4000\n    terminal Z: \u003e blah [ press ENTER ]\n\n### TiDB with docker-compose\n\n    $ go build\n    $ cp tiproxy docker/bin\n    $ docker build -t tiproxy:latest ./docker\n    $ docker-compose -f ./docker/docker-compose.yml up \n    $ mysql --host 127.0.0.1 --port 4000 -u root\n    $ mysql --host 127.0.0.1 --port 4000 -u root\n    \n### Architecture\n\n    Client -\u003e Proxy -\u003e Pool -\u003e Resource\n      |\n      conn -\u003e  get  -\u003e  if -\u003e  exists\n                         |       |\n      done \u003c----------- conn \u003c---/\n                         |\n                        else -\u003e spawn \\\n                         or      |    |\n                        wait \u003c---/    |\n                         |            |\n      done \u003c----------- conn          |\n      ...                             |\n    release -\u003e put       /------------/\n                |        |           \n      done  \u003c-  *        v (spawn monitor)            \n                        ...\n                      Monitor Resource\n                      timeout and no connections\n                         |  -\u003e  kill\n                         |       | \n                       killed \u003c- /        \n                         |\n                        exit\n                        \nPool uses `sync.Cond` to control state transitions\nbetween executing coroutines. A calling coroutine\nprocesses pool state change. Every new resource has\nits own controlling monitor that exits as soon as\nresource disappears.\n\nPool uses `sync.Mutex` to control its state. States\nswitch between: `closed, opened, starting, shutdown`.\nPool tracks usage statistics counting connections and\nkeeping the latest change time.\n\nResource monitor respects SIGCHLD signals.\n\nProxy uses `io.Copy` creating 2 coroutines to serve\nTCP connections 2-way.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitano%2Ftiproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsitano%2Ftiproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitano%2Ftiproxy/lists"}