GalateaEngine / Galatea

Project Galatea lays the foundation for an open-source & open-hardware humanoid robot with an emphasis on assistance and companionship.
13 stars 2 forks source link

S-MS-Proxy: Proxy Routing microservice #7

Open AxelAli opened 5 years ago

AxelAli commented 5 years ago

Develop a proxy similar to http://anyproxy.io/en/

Desired features:

How Should it behave:

  route: {
    in: {
      stringMatcher: "order/add",
      port: 8080,
      methods: ["POST"],
      passQuery:true
    },
    out: { endpoint: "add", domain: "localhost", port: 8080 }
  }

This will connect incomming POST localhost:8080/order/add?order=123 to localhost:9000/add?order=123

  route: {
    in: {
      regexMatcher: "/\.(jpg)$/",
      port: 3000,
      methods: ["GET"],
      passPath: true
    },
    out: { endpoint: "files/", domain: "localhost", port: 8080 }
  }

This will connect incoming GET localhost:3000/myFile.jpg to localhost:8080/files/myFile.jpg