Skip to content

the-plan/k-reverse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reverse

Run an instance of the reverse-proxy

First, run Redis

redis-server

Then

PORT=9090 SERVICE_PORT=9090 ADMIN_PORT=9999 java  -jar target/k-reverse-1.0-SNAPSHOT-fat.jar

Now, you can:

  • use the proxy: http://localhost:9090/
  • use the proxy admin:
    • get the list of all reverse-proxies: http://localhost:9999/admin/proxies
      [ [ {
        "location" : {
          "endpoint" : "http://localhost:9090/api",
          "host" : "localhost",
          "port" : 9090,
          "root" : "/api",
          "ssl" : false
        },
        "metadata" : {
          "message" : "hello 🌍",
          "kind" : "reverse-proxy",
          "admin" : {
            "host" : "localhost",
            "port" : 9999,
            "enpoint" : "http://localhost:9999/admin",
            "services" : [ {
              "webapps" : "/webapps"
            }, {
              "proxies" : "/proxies"
            } ]
          }
        },
        "name" : "my-service-silent-salad-023",
        "status" : "UP",
        "registration" : "6c687aeb-dcb6-47a7-bfbc-48e50df1d825",
        "type" : "http-endpoint"
      } ] ]
    • get the list of all webapps: http://localhost:9999/admin/webapps
      [ [ {
        "id" : "webapp_new1",
        "ip" : "192.168.1.31",
        "port" : 8080,
        "status" : "😍"
      }, {
        "id" : "webapp_new2",
        "ip" : "192.168.1.32",
        "port" : 8080,
        "status" : "😍"
      } ] ]

Add a webapp to the reverse-proxy

curl -H "Content-Type: application/json" -X POST -d '{"id":"webapp_new1","ip":"192.168.1.31","port":8080}' "http://localhost:9999/admin/webapps"

Remove a webapp from the reverse-proxy

curl -X DELETE "http://localhost:9999/admin/webapps/webapp1"

WIP 🚧 more to come...

Releases

No releases published

Packages

No packages published