Discovery and bridge access fail with 501 when using a HTTP proxy
See original GitHub issueReproduction
- 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. - Run
hue.discovery.nupnpSearch();
- 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
- The HTTP proxy is used for contacting the local Hue bridge. That is likely to fail.
- 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
- If you want to use HTTPS or TLS request via HTTP proxy, the HTTP CONNECT protocol is required.
- The HTTP proxy is not used for contacting the Hue bridge, because the bridge is local. The HTTP proxy is for the Internet.
- 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.
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
How to Fix the HTTP 501 Not Implemented Error on Your Site
The HTTP 501 Not Implemented status code indicates that the server does not support the functionality required to fulfill the request.
Read more >Aruba 501 Wireless Bridge stopped working? | Wireless Access
Help needed with Aruba Web-CC / PEF on Conductor/Controller setup ... Is it possible to discover Aruba Access Points (IAP) in virtual controller,...
Read more >Discovery or metric collection failed - ITOM Practitioner Portal - Micro ...
Cause 1. The AWS collector is unable to reach the target AWS account if you haven't configured a proxy or configured a wrong...
Read more >How to Fix the HTTP Error Code 501 - Elegant Themes
What Can You Do About a 501 Error? · 1. Reload The Page · 2. Clear Your Browser Cache · 3. Check Your...
Read more >HTTP-Proxy: Exceptions - WatchGuard Technologies
Request headers and response headers are parsed by the HTTP-proxy even when the traffic matches the HTTP-proxy exception. If a parsing error does...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks, I will be cutting a new 5.x release soon with this fix in it
Hi!
I have the same issue as @benbucksch, especially when trying to connect to a local bridge but through an http proxy.
I didn’t find a way to make it work using the 4.0.9 release, but I switched to the
main
branch instead and usedglobal-agent
as well, it does now work!If anyone else stumble across this issue, here is a quick proxy setup:
🎉