wave icon indicating copy to clipboard operation
wave copied to clipboard

Display message if proxy detected

Open g-eoj opened this issue 3 years ago • 4 comments

Is your feature request related to a problem? Please describe

If user has a proxy set, wave app may not be able to communicate with wave server for local development. Figuring out this is the cause of apps not working takes a lot of time as there's no indication what went wrong.

Describe the solution you'd like

Display a message in terminal at server startup if proxy detected. H2O-3 has a nice way of detecting this: https://github.com/h2oai/h2o-3/blob/4219ea6deaf8fd84ac9e4b93f915b4caea16afb5/h2o-py/h2o/backend/connection.py#L365-L371

g-eoj avatar Jun 22 '22 16:06 g-eoj

What kind of proxy is meant here? The -proxy option in Wave server?

mturoci avatar Jun 23 '22 00:06 mturoci

proxy environment vars

g-eoj avatar Jun 23 '22 00:06 g-eoj

Repro of behavior. Server is running on local but app can't find it and gets stuck.

❯ export http_proxy=<valid url>
❯ wave run steam_stats.py
INFO:     Will watch for changes in these directories: ['/Users/.../steam-stat']
INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO:     Started reloader process [69342] using statreload
INFO:     Started server process [69346]
INFO:     Waiting for application startup.
INFO:     Application startup complete.

g-eoj avatar Jun 23 '22 01:06 g-eoj

Server is running on local but app can't find it and gets stuck.

The app should timeout rather than hang, so will need to investigate that on our side - cc @lo5

Display a message in terminal at server startup if proxy detected. H2O-3 has a nice way of detecting this:

On second thought, this is more of an env related rather than Wave related. Wouldn't running printenv | grep -i proxy yourself suffice?

mturoci avatar Jul 01 '22 08:07 mturoci