IceWhaleTech/CasaOS-Gateway
Fork: 18 Star: 18 (更新于 2024-10-18 00:24:42)
license: Apache-2.0
Language: Go .
CasaOS Gateway is a dynamic API gateway service that can be used to expose APIs from different other HTTP based services.
最后发布版本: v0.4.9-alpha4 ( 2024-07-18 16:15:22)
CasaOS-Gateway
CasaOS Gateway is a dynamic API gateway service that can be used to expose APIs from different other HTTP based services.
This gateway service comes with a simple management API for other services to register their APIs by route paths. A HTTP request arrived at gateway port will be forwarded to the service that is registered for the route path.
As a best practice, a service behind this gateway should bind to localhost (
127.0.0.1
for IPv4,::1
for IPv6) ONLY, so no external network access is allowed.
Configuration
Upon launching, it will search for gateway.ini
file in the following order:
./gateway.ini
./conf/gateway.ini
$HOME/.casaos/gateway.ini
/etc/casaos/gateway.ini
See gateway.ini.sample for default configuration.
Running
Once running, gateway address and management address will be available in the files under RuntimePath
specified in configuration.
$ cat /var/run/casaos/gateway.url
[::]:8080 # port is specified in configuration
$ cat /var/run/casaos/management.url
[::]:34703 # port is randomly assigned
Example
Assuming that
- the management API is running on port
34703
- the gateway is running on port
8080
- some API running at
http://localhost:12345/ping
that simply returnspong
.
Then register the API as follows:
-
POST
http://localhost:34703/v1/gateway/routes
{ "path": "/ping", "target": "http://localhost:12345" }
or in command line:
$ curl 'localhost:34703/v1/gateway/routes' --data-raw ' {"path": "/ping", "target": "http://localhost:12345"} '
Now run
$ curl localhost:8080/ping
{"message":"pong"}
... which is equivalent as
$ curl localhost:12345/ping
{"message":"pong"}
最近版本更新:(数据更新于 2024-09-22 00:01:12)
2024-07-18 16:15:22 v0.4.9-alpha4
2024-07-12 16:29:36 v0.4.9-alpha3
2024-06-03 18:28:37 v0.4.9-alpha2
2024-03-12 16:53:59 v0.4.8-alpha2
2024-03-08 16:57:29 v0.4.8-alpha1
2024-01-15 18:51:23 v0.4.5-alpha2
2024-01-15 18:05:21 v0.4.5-alpha1
2023-11-23 12:02:09 v0.4.4-3-alpha5
2023-11-20 16:47:02 v0.4.4-3-alpha3
2024-01-15 18:05:00 v0.4.4-3-alpha2
主题(topics):
api-gateway, gateway, go, golang, http, rest-api
IceWhaleTech/CasaOS-Gateway同语言 Go最近更新仓库
2024-11-06 07:46:48 dolthub/dolt
2024-11-06 03:37:39 containerd/containerd
2024-11-05 20:42:00 aurora-develop/aurora
2024-11-05 08:55:31 XTLS/Xray-core
2024-11-05 00:03:47 SagerNet/sing-box
2024-11-04 20:34:19 Permify/permify