MyGit
🚩收到GitHub仓库的更新通知

IceWhaleTech/CasaOS-Gateway

Fork: 15 Star: 16 (更新于 2024-05-06 03:48:25)

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.8-alpha2 ( 2024-03-12 16:53:59)

GitHub网址

✨免费申请网站SSL证书,支持多域名和泛域名,点击查看

CasaOS-Gateway

Go Reference Go Report Card goreleaser codecov

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 returns pong.

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-05-12 02:51:44)

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

2024-01-15 18:04:28 v0.4.4-3-alpha1

2024-01-15 18:03:58 v0.4.4-2-alpha5

2023-10-19 15:32:49 v0.4.4-2-alpha4

主题(topics):

api-gateway, gateway, go, golang, http, rest-api

IceWhaleTech/CasaOS-Gateway同语言 Go最近更新仓库

2024-05-15 05:56:56 kubernetes/kubernetes

2024-05-14 22:14:31 aurora-develop/aurora

2024-05-14 17:44:23 flipped-aurora/gin-vue-admin

2024-05-14 15:54:13 youki992/VscanPlus

2024-05-14 07:40:51 istio/istio

2024-05-14 03:10:35 sashabaranov/go-openai