h2oai / wave

Realtime Web Apps and Dashboards for Python and R
https://wave.h2o.ai
Apache License 2.0
4.01k stars 328 forks source link

Display message if proxy detected #1515

Open g-eoj opened 2 years ago

g-eoj commented 2 years ago

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

mturoci commented 2 years ago

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

g-eoj commented 2 years ago

proxy environment vars

g-eoj commented 2 years ago

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.
mturoci commented 2 years ago

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?