zhboner / realm

A network relay tool
MIT License
1.54k stars 285 forks source link

Support include endpoints function #135

Closed HanadaLee closed 3 weeks ago

HanadaLee commented 2 months ago

In realm, endpoints are similar to the role of nginx servers. However, they can only be used in a single configuration file. If there are a large number of forwarding rules, it will be troublesome to manage the configuration file. I hope to implement endpoint-based file parsing.

Here is an example

realm.json

{
  "external_endpoints": "./endpoints/*.json",
  "endpoints": [
    {
      "listen": "0.0.0.0:5000",
      "remote": "1.1.1.1:443"
    },
    {
      "listen": "0.0.0.0:10000",
      "remote": "www.google.com:443"
    }
  ]
}

./endpoints/cloud.google.com.json

{
      "listen": "0.0.0.0:10001",
      "remote": "cloud.google.com:443"
}
zephyrchien commented 2 months ago

The proposal sounds good to me. Personally I would like to have HTTP API implemented first, the configuration file loading process will then go the API path.

zephyrchien commented 3 weeks ago

141 would be helpful to reduce the complexity of managing config files.

zephyrchien commented 3 weeks ago

wait for #91