{"id":22152440,"url":"https://github.com/sinri/dothan","last_synced_at":"2025-03-24T13:26:39.616Z","repository":{"id":57734833,"uuid":"109678656","full_name":"sinri/Dothan","owner":"sinri","description":"A light TCP proxy. You can take it as MySQL proxy, might also work for SSH.","archived":false,"fork":false,"pushed_at":"2022-01-25T05:01:13.000Z","size":5037,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T18:33:52.377Z","etag":null,"topics":["tcp-proxy"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sinri.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}},"created_at":"2017-11-06T10:09:12.000Z","updated_at":"2019-04-14T12:23:31.000Z","dependencies_parsed_at":"2022-08-28T03:21:10.800Z","dependency_job_id":null,"html_url":"https://github.com/sinri/Dothan","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinri%2FDothan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinri%2FDothan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinri%2FDothan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinri%2FDothan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sinri","download_url":"https://codeload.github.com/sinri/Dothan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245278059,"owners_count":20589244,"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":["tcp-proxy"],"created_at":"2024-12-02T00:51:26.965Z","updated_at":"2025-03-24T13:26:39.591Z","avatar_url":"https://github.com/sinri.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dothan\n\n![GitHub Release](https://img.shields.io/github/release/sinri/Dothan.svg)\n![GitHub](https://img.shields.io/github/license/sinri/Dothan.svg)\n[![Docs Site](https://img.shields.io/badge/link-docs-blue.svg)](https://sinri.github.io/Dothan/)\n\nA light TCP proxy. You can take it as MySQL proxy, might also work for SSH.\n\n\u003e And the man said, They are departed hence; for I heard them say, Let us go to Dothan. And Joseph went after his brethren, and found them in Dothan. (Genesis 37:17 )\n\n\u003e And he said, Go and spy where he [is], that I may send and fetch him. And it was told him, saying, Behold, [he is] in Dothan....And Elisha said unto them, This [is] not the way, neither [is] this the city: follow me, and I will bring you to the man whom ye seek. But he led them to Samaria. (2 Kings 6:13,19)\n\n## Package\n\nSince Version 6, new package `io.github.sinri.Dothan` is adopted to the this project.\n\n## Maven Access\n\n[OSS-SONATYPE](https://oss.sonatype.org/content/groups/public/io/github/sinri/Dothan/)\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.github.sinri\u003c/groupId\u003e\n  \u003cartifactId\u003eDothan\u003c/artifactId\u003e\n  \u003cversion\u003e6.0.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Deploy Note\n\nYou should export your `JAVA_HOME` first. In Mac OS X, you may run `/usr/libexec/java_home` to get correct path for it.\n\nCommonly snapshot is used for quick deploy with default version tag `6.0-SNAPSHOT` or so, run `mvn clean package deploy -P snapshot` to update. \n\nTo release new version to OSS-SONATYPE, run `mvn clean package deploy -P release` after correcting the version.\n\n## Environment\n\n* Java 8\n\n## Maven Dependencies\n\n* io.vertx core\n* Apache commons cli\n* Apache commons validator\n\n## License\n\nGPLv3\n\n## Get Runnable Package\n\nYou can obtain the runnable package in two ways.\n\n1. Download JAR file from GitHub release area.\n1. Use Maven 3, run `mvn clean package`. \n\n\n## Usage (As of Version 2.0)\n\nusage: options\n\n     -b \u003carg\u003e   blacklist, separate IP with comma (as of 4.0)\n     -c \u003carg\u003e   Set proxy config file. If not use this, h,p and l are needed.\n     -d         use detail mode\n     -h \u003carg\u003e   database host\n     -help      Display help information\n     -k         keep config and no hot update\n     -l \u003carg\u003e   listen local port\n     -p \u003carg\u003e   database port\n     -w \u003carg\u003e   whitelist, separate IP with comma (as of 4.0)\n\n### Quick Proxy \n\nRun Dothan quickly for one proxy, *h*ost, *p*ort and *l*isten port are required, and *d*etail mode is also available.\n\n    java -jar Dothan.jar -d -hdatabase.com -p3306 -l20001\n\n### Configured Proxy\n\nYou should provide a config file as *c*onfig parameter.\n\nThe config file should contain one or more lines and each for one proxy requirement.\nThe format is `[LISTEN_PORT]:[SERVER_HOST]:[SERVER_PORT]` as of 5.0. \nPrevious format `[LISTEN_PORT] [SERVER_HOST]:[SERVER_PORT]` is still supported though not recommended now. \n\nThe lines with leading Sharp(#) would be treated as comments. \n\nThe lines with leading Plus(+) would be treated as IP Address in whitelist. If no such lines, whitelist is ignored.\n\nThe lines with leading Minus(-) would be treated as IP Address in blacklist. If no such lines, blacklist is ignored.\n\nHere is an example:\n\n````\n# Dothan Config [SAMPLE]\n\n+ 127.0.0.1\n- 192.168.0.2\n\n20001:1.rds.aliyuncs.com:3306\n20002:2.rds.aliyuncs.com:3306\n````\n\nThe command would be as following if the config file path is  `/path/to/Dothan.config`.\n\n    java -jar Dothan.jar -d -c /path/to/Dothan.config\n\n### Hot Update Version\n\nAs of version 3.0, the hot version update is available for Config-File Mode.\n\nThis relies on the version declaration in configuration file as a line:\n\n    # Dothan Config Version VERSION_CODE\n\nThe version code should be an *positive* integer. \nIf there are more than one line in this format, the last would be used. \nThe file would be watched by the Dothan process and update config if the current version code became greater.\n\nSince version 3.1, Dothan uses WatchService for hot update function, and provide a parameter (-k) to disable hot update.\n\n## Translate Mode\n\nWe have to admit, the network is not so safe. That is why the service provider make databases not accessible from outside.\nHowever, we have certain time to access to such service, but we may be afraid that our connections would be seen by others through public network.\nSo we might use the translate mode to pass our data encrypted, with two new parameters `MODE` and `TRANSFER KEY`, as of version 5.0.\n\n````\n                  [CLIENT] \n                    |  ↑\n       PLAIN TEXT   |  |   PLAIN TEXT\n                    ↓  |\n      encrypt [DOTHAN   LOCAL] decrypt\n                    |  ↑\n       SECRET BYTES |  | SECRET BYTES\n                    ↓  |\n      decrypt [DOTHAN  REMOTE] encrypt\n                    |  ↑\n       PLAIN TEXT   |  |   PLAIN TEXT\n                    ↓  |\n             [SERVICE PROVIDER]\n````\n\nOn `DOTHAN LOCAL` the config file should contain transfer mode `ENCRYPT` and key.\n\n```\n# MODE ENCRYPT\n# TRANSFER KEY t8o7diugf8iauyvge8iu\n\n[DOTHAN_LOCAL_PORT]:[DOTHAN_REMOTE_ADDRESS]:[DOTHAN_REMOTE_PORT]\n\n```\n\nWhile on `DOTHAN REMOTE` the config file should contain transfer mode `DECRYPT` and key.\n\n```\n# MODE DECRYPT\n# TRANSFER KEY t8o7diugf8iauyvge8iu\n\n[DOTHAN_REMOTE_PORT]:[SERVER_ADDRESS]:[SERVER_PORT]\n\n```\n\nSo your request sent to the `DOTHAN_LOCAL_PORT` of `DOTHAN LOCAL` would be transferred to `DOTHAN REMOTE` and finally reach the actual service provider. \n\nIf you like, you can use more than one Dothan pair to make the connection chain.\n\n----\n\n## Museum: Version 1.1 (deprecated)\n\n    java -jar target/Dothan-1.1-SNAPSHOT.jar some.mysql.rds.aliyuncs.com 3306 33306\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinri%2Fdothan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinri%2Fdothan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinri%2Fdothan/lists"}