docs icon indicating copy to clipboard operation
docs copied to clipboard

Really unclear on how proxies and ports work

Open chopfitzroy opened this issue 5 years ago • 8 comments

Please complete the following:

Link to the page that needs to be updated or changed.

https://docs.lando.dev/config/proxy.html#proxy https://docs.lando.dev/config/services.html#localhost-assignment

Describe the change you'd like

This could be a sever lack of understanding on my part despite reading the docs with a fine tooth comb 🤣 however there could be a bug or two in here muddying my understanding.

There are a range of config options that I can not get my head around and I found the docs didn't accurately outline how they are intended to function, these config options are:

  • proxy
  • port (node specific)
  • ssl
  • scanner
  • overrides (this one is relatively clear I just think there are some caveats)
  • moreHttpPorts

I have included my config below as well as my accompanying deductions about how these config options work.

Provided my understanding of these options is correct I would like to work towards improving there documentation as a whole as well as individually.

My configuration file
name: portfolio

proxy:
  server:
    - portfolio.lndo.site:5000

services:
  server:
    type: node
    # port: 5000
    ssl: true
    # scanner: false
    # Livereload port
    moreHttpPorts:
     - '35729'
    overrides:
      ports:
       - '35729:35729'
    run_as_root:
     - chown node -R /certs

tooling:
  npm:
    service: server
  node:
    service: server

Console output when running the above configuration:

 SERVER URLS  http://localhost:35729
              https://localhost:32797
              http://portfolio.lndo.site/
              https://portfolio.lndo.site/

Now from toggling things on and off here is what I get:

  • proxy seems to work as expected and the portfolio.lndo.site URL's work perfectly when using it, however when I tried to remove the proxy and use port: 5000 the website no longer renders, despite the fact that port seems to be specifically enabled to help with node apps running on strange ports
  • Enabling ssl: true creates a URL with a random port every time I rebuild, in this case https://localhost:32797 and logs it to the console
  • scanner: false does not disable the URL with the random port from ssl: true which based on it's description I thought it would have
  • overrides maps the port to my host machine without actually adding anything to the console (that is to say that overrides works without moreHttpPorts but you get no output in the console)
  • moreHttpPorts simply seems to log ports to the console on startup but doesn't actually work without the overrides block.
  • The URL's logged out by moreHttpPorts can actually be https or http so perhaps it is worth just using // or no prefix at all?

If the above is correct or even partially correct it was the result of much commenting lines on and off in an attempt to distil how they operate together, I believe this could be better documented.

chopfitzroy avatar Apr 28 '20 10:04 chopfitzroy