[PR #191] [MERGED] Make WebSocket connection protocol dependent #2661

Closed
opened 2026-03-20 21:08:10 +01:00 by sascha_hemi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/OpenEPaperLink/OpenEPaperLink/pull/191
Author: @pablogonzalezalba
Created: 1/4/2024
Status: Merged
Merged: 1/4/2024
Merged by: @nlimper

Base: masterHead: websocket-protocol-dependent


📝 Commits (2)

  • 51c4294 Support secure WebSockets when loading via https
  • b42bb92 Update main.js.gz from main.js

📊 Changes

2 files changed (+2 additions, -1 deletions)

View changed files

📝 ESP32_AP-Flasher/data/www/main.js.gz (+0 -0)
📝 ESP32_AP-Flasher/wwwroot/main.js (+2 -1)

📄 Description

Currently, the connection to WebSockets is hardcoded to the protocol ws://.

If the server is put behind a proxy server (like Nginx) to support https, the connection to websockets will fail (at least in Firefox) due to insecure protocol.

This change checks the current protocol and connects to wss if loaded via https, which makes it work when loaded via proxy.


I updated the file main.js.gz by just compressing main.js. Is that the correct way?

Please let me know if I'm missing anything.
Thanks for the great project, I use it a lot!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/OpenEPaperLink/OpenEPaperLink/pull/191 **Author:** [@pablogonzalezalba](https://github.com/pablogonzalezalba) **Created:** 1/4/2024 **Status:** ✅ Merged **Merged:** 1/4/2024 **Merged by:** [@nlimper](https://github.com/nlimper) **Base:** `master` ← **Head:** `websocket-protocol-dependent` --- ### 📝 Commits (2) - [`51c4294`](https://github.com/OpenEPaperLink/OpenEPaperLink/commit/51c4294f47ba6a1c1885915fcd5895afda85719b) Support secure WebSockets when loading via https - [`b42bb92`](https://github.com/OpenEPaperLink/OpenEPaperLink/commit/b42bb9265f8e9909282dc4217dacfdbd0a061e36) Update main.js.gz from main.js ### 📊 Changes **2 files changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `ESP32_AP-Flasher/data/www/main.js.gz` (+0 -0) 📝 `ESP32_AP-Flasher/wwwroot/main.js` (+2 -1) </details> ### 📄 Description Currently, the connection to WebSockets is hardcoded to the protocol `ws://`. If the server is put behind a proxy server (like Nginx) to support `https`, the connection to websockets will fail (at least in Firefox) due to insecure protocol. This change checks the current protocol and connects to `wss` if loaded via `https`, which makes it work when loaded via proxy. --- I updated the file `main.js.gz` by just compressing `main.js`. Is that the correct way? Please let me know if I'm missing anything. Thanks for the great project, I use it a lot! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
sascha_hemi added the pull-request label 2026-03-20 21:08:10 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/OpenEPaperLink#2661