golemfactory / dapp-runner

GNU Lesser General Public License v3.0
5 stars 6 forks source link

http proxy support for dapp-runner #13

Closed shadeofblue closed 2 years ago

shadeofblue commented 2 years ago

support for Local HTTP Proxy in dapp runner

independently from the descriptor -> just add local http proxy support to all dapps

johny-b commented 2 years ago
  1. This should cover a case when we have more than one service
  2. --> They should work either on separate ports
  3. --> Important: the port should be passed to the data stream
  4. Also: we should somehow detect "free" ports, as there might be more that one runner at a given time
johny-b commented 2 years ago

Details:

  1. We don't care about anything related to http-proxy and/or network in the descriptor
  2. BUT: when reading the descriptor, we have a mocked element that for each service:
    • sets some internal port (hardcoded value)
    • sets a range of external ports (also hardcoded)
  3. Runner creates a network with hardcoded arguments, this will be improved in #18
  4. Runner, for each service with specified (internal_port, range_of_external_ports):
    • finds a free port in range, or raises an exception (TODO: what exception?)
    • sets up the http proxy between (internal_port, this_found_free_port)
    • information about the selected free port is passed to the data stream. Preferably: as a complete base URL.