Skip to content

Discovery and bridge access fail with 501 when using a HTTP proxy #171

@benbucksch

Description

@benbucksch

Reproduction

  1. Set environment variable https_proxy=myproxy:1234, whereas myproxy:1234 is a Squid proxy. This is a global user config, applying to the entire user session, set e.g. (among others) by the GNOME settings tool for the GNOME browser.
  2. Run hue.discovery.nupnpSearch();
  3. Manually configure the bridge IP address and run hue.api.createLocal(hueBridgeLocalIPAddress).connect();

Actual result

Both calls (step 2 and step 3) return with error message:

Request failed with status code 501
  1. The HTTP proxy is used for contacting the local Hue bridge. That is likely to fail.
  2. The HTTP proxy request used is invalid. The protocol implementation is incorrect. This is a TLS request, so the HTTP CONNECT command is required, but it's not used, leading to the error.

Expected result

  1. If you want to use HTTPS or TLS request via HTTP proxy, the HTTP CONNECT protocol is required.
  2. The HTTP proxy is not used for contacting the Hue bridge, because the bridge is local. The HTTP proxy is for the Internet.
  3. It may be helpful to use the HTTP proxy for contacting the discovery.meethue.com server, but given that the Hue bridge contacts the server without proxy, it's actually more privacy-preserving not to use the proxy, to avoid that the Hue server can associate the proxy IP address and real IP address. So, even in this case, I recommend to ignore the HTTP proxy.

It's better to completely un-support and ignore proxies than doing an invalid request that will fail.

In short: Don't use the HTTP proxy at all. It makes no sense for this API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions