Websockets through proxy returning 401 on raspberry pi
Posted: Thu Dec 17, 2020 12:07 am
Hi,
I hope I have come to the right place!
I am using NGINX (on another machine) to reverse proxy QLC's websocket on the raspberry using this configuration:
It works fine on a web browser, when I visit a small script I made and also through the QLC web API test ( https://www.qlcplus.org/Test_Web_API.html ), I had to download the html file first though, as the operation was deemed not secure by firefox, because the webpage was loaded in HTTPS and the websocket was not wss.
But when I try and run a python (or Node.js) file, I am situated with a 401 error message:
I also tried directly connecting to the raspberry pi's local IP, but it has the same outcome
Any ideas how I can fix this? Let me know if you need any other information!
Thanks
I hope I have come to the right place!
I am using NGINX (on another machine) to reverse proxy QLC's websocket on the raspberry using this configuration:
Code: Select all
location / {
proxy_pass http://192.168.*.*:9999;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_read_timeout 999999999;
But when I try and run a python (or Node.js) file, I am situated with a 401 error message:
Code: Select all
websocket._exceptions.WebSocketBadStatusException: Handshake status 401 Unauthorized
Any ideas how I can fix this? Let me know if you need any other information!
Thanks