{"id":20993180,"url":"https://github.com/water-melon/menet","last_synced_at":"2026-03-12T06:40:12.795Z","repository":{"id":61414911,"uuid":"489861094","full_name":"Water-Melon/Menet","owner":"Water-Melon","description":"This is NOT an Objective-C project. Menet is a TCP-based reverse proxy to help you expose a local server behind a NAT. It can be dynamically configured through HTTP requests. This is an experimental project, do NOT use it in production.","archived":false,"fork":false,"pushed_at":"2023-02-18T03:44:57.000Z","size":91,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-14T20:43:17.985Z","etag":null,"topics":["api","gateway","middleware","network","proxy","reverse-proxy","tcp","tunnel"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Water-Melon.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,"zenodo":null}},"created_at":"2022-05-08T06:07:36.000Z","updated_at":"2023-12-16T01:37:01.000Z","dependencies_parsed_at":"2025-05-14T20:49:35.013Z","dependency_job_id":null,"html_url":"https://github.com/Water-Melon/Menet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Water-Melon/Menet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Water-Melon%2FMenet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Water-Melon%2FMenet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Water-Melon%2FMenet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Water-Melon%2FMenet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Water-Melon","download_url":"https://codeload.github.com/Water-Melon/Menet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Water-Melon%2FMenet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30417542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T04:41:02.746Z","status":"ssl_error","status_checked_at":"2026-03-12T04:40:12.571Z","response_time":114,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["api","gateway","middleware","network","proxy","reverse-proxy","tcp","tunnel"],"created_at":"2024-11-19T07:13:57.892Z","updated_at":"2026-03-12T06:40:12.778Z","avatar_url":"https://github.com/Water-Melon.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg width=\"210\" src=\"https://github.com/Water-Melon/Melon/blob/master/docs/logo.png?raw=true\" alt=\"Melon logo\"\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://img.shields.io/github/license/Water-Melon/Menet\" /\u003e\u003c/p\u003e\n\u003ch1 align=\"center\"\u003eMenet\u003c/h1\u003e\n\n\n\nMenet is a TCP network middleware that can be dynamically modified through HTTP requests.\n\nThis is an **experimental** project, do **NOT** use it in production.\n\nMenet is like a combination of `Nginx UNIT` and `FRP`. On the one hand, users can use Menet to build their own tunnel or proxy services like `FRP`, and on the other hand, these services can dynamically configure routing like `Nginx UNIT`.\n\n\n\n## Installation\n\nMenet is written by [Melang](https://github.com/Water-Melon/Melang) which is a script language. So we just Install `melang`, please refer to the `README` of `Melang` repository.\n\n\n\n## Usage\n\n### Start the service\n\n```shell\n$ melang menet.m\n```\n\n### Configuration\n\nThe configuration file is `conf.m`. The code in this file is a Melang array structure.\n\n```\nconf = [\n    'admin': [ //HTTP API listen address\n        'ip': '0.0.0.0', \n        'port': '1234'\n    ],\n    'tunnel': [ //tunnel server listen address\n        'ip': '0.0.0.0',\n        'port': '4321'\n    ],\n];\n```\n\nMenet is both a tunnel client and a tunnel server.\n\n### APIs\n\nThere are four APIs:\n\n- tunnel\n- service\n- bind\n- config\n\n#### tunnel\n\nAdd or remove a tunnel, and complete the establishment of tunnel TCP and information synchronization.\n\n```\nhttp://ip:port/tunnel\n```\n\n- HTTP Method: `POST`|`DELETE`\n\n- HTTP Body:\n\n  ```json\n  {\n      \"name\": \"tunnel name\",\n      \"dest\": [\"ip\", \"port\"]\n  }\n  ```\n\n  `name` will be synchronized to tunnel server automatically.\n\n#### service\n\nAdd or remove a service. There are two kinds of services:\n\n- local\n- remote\n\n`local` service represents the service that listens on the port locally, and the `remote` service represents which service to establish a TCP connection to.\n\n```\nhttp://ip:port/service\n```\n\n- HTTP Method: `POST`|`DELETE`\n\n- HTTP Body:\n\n  ```\n  {\n      \"name\": \"service name\",\n      \"key\": \"rc4 key\",\n      \"timeout\": 1000, //Connection timeout, in milliseconds. It's optional. If omitted, it means no timeout.\n      \"type\": \"local|remote\",\n      \"addr\": [\"ip\", \"port\"]\"\n  }\n  ```\n\n#### bind\n\nAdd or remove a tunnel-service mapping relationship. And of course, because there are two types of services, the mapping relationship is also divided into `local` and `remote`.\n\nIf you want to build a tunnel proxy service, you need to set the `bind` of the `local` service (assumed to be named `service1`) and the tunnel (assumed to be named `tunnel1`) on a Menet service, then you need to set up a `remote` service (also named `service1`) and tunnel (also named `tunnel1`) bind on the peer tunnel.\n\n```\nhttp://ip:port/bind\n```\n\n- HTTP Method: `POST`|`DELETE`\n\n- HTTP Body:\n\n  ```json\n  {\n      \"tunnel\": \"tunnel name\",\n      \"service\": \"service name\",\n      \"type\": \"local|remote\"\n  }\n  ```\n\n#### config\n\nDisplay the configuration on Menet service.\n\n```\nhttp://ip:port/config\n```\n\n- HTTP Method: `GET`\n- HTTP Body: None\n\n#### Example\n\n```\n                  |---------------|                      |------------------|\n    service1      |192.168.1.2    |        tunnel1       |192.168.1.3       |   service1\n----------------\u003e |8080    Menet  |---------------------\u003e|4321      Menet   |--------------\u003e192.168.1.3:80\n                  |admin port:1234|                      |admin port:1234   |\n                  |---------------|                      |------------------|\n```\n\nIf we expect to get the 80 service content of 192.168.1.3 by accessing the 8080 port of 192.168.1.2, we need to make the following API calls:\n\n```\n$ curl -XPOST -d '{\"name\":\"tunnel1\", \"dest\":[\"192.168.1.3\", \"4321\"]}' http://192.168.1.2:1234/tunnel\n$ curl -XPOST -d '{\"name\":\"service1\", \"key\":\"UHI@\u0026s8sa*S\", \"type\": \"local\", \"addr\":[\"0.0.0.0\", \"8080\"]}' http://192.168.1.2:1234/service\n$ curl -XPOST -d '{\"name\":\"service1\", \"key\":\"UHI@\u0026s8sa*S\", \"type\": \"remote\", \"addr\":[\"192.168.1.3\", \"80\"]}' http://192.168.1.3:1234/service\n$ curl -XPOST -d '{\"tunnel\": \"tunnel1\", \"service\":\"service1\", \"type\": \"local\"}' http://192.168.1.2:1234/bind\n$ curl -XPOST -d '{\"tunnel\": \"tunnel1\", \"service\":\"service1\", \"type\": \"remote\"}' http://192.168.1.3:1234/bind\n```\n\nWe don't have to send `tunnel` request to `192.168.1.3`, because the first command will help us to establish TCP and synchronize tunnel name to it.\n\nYou can now check the configuration of both Menet services using the `config` request.\n\n\n\n## License\n\n[GNU Affero General Public License v3.0](https://github.com/Water-Melon/Menet/blob/master/LICENSE)\n\nCopyright (c) 2022-present, Niklaus F. Schen\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwater-melon%2Fmenet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwater-melon%2Fmenet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwater-melon%2Fmenet/lists"}