[PR #60] [MERGED] Update html.go: use wss if https is used #61

Closed
opened 2026-03-02 04:09:07 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/gen2brain/cam2ip/pull/60
Author: @tacoverflow
Created: 9/16/2025
Status: Merged
Merged: 9/17/2025
Merged by: @gen2brain

Base: masterHead: hotfix/use-secure-websockets-if-https-is-used


📝 Commits (1)

  • 1e6eae1 Update html.go: use wss if https is used

📊 Changes

1 file changed (+10 additions, -2 deletions)

View changed files

📝 handlers/html.go (+10 -2)

📄 Description

A very simple change to use wss in case that the connection is done through https so /html page will show an image.
If this is not in place and you put the endpoint behind a reverse proxy like nginx with ssl cert enable the browser will complain about security risks and you will see this messages on the logs.

sh[151588]: 2025/09/14 15:31:45 socket: accept: failed to accept WebSocket connection: WebSocket protocol violation: handshake request must be at least HTTP/1.1: "HTTP/1.0"

🔄 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/gen2brain/cam2ip/pull/60 **Author:** [@tacoverflow](https://github.com/tacoverflow) **Created:** 9/16/2025 **Status:** ✅ Merged **Merged:** 9/17/2025 **Merged by:** [@gen2brain](https://github.com/gen2brain) **Base:** `master` ← **Head:** `hotfix/use-secure-websockets-if-https-is-used` --- ### 📝 Commits (1) - [`1e6eae1`](https://github.com/gen2brain/cam2ip/commit/1e6eae1e1408dcb01aaa2d37dbb2d8ebfeddf718) Update html.go: use wss if https is used ### 📊 Changes **1 file changed** (+10 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `handlers/html.go` (+10 -2) </details> ### 📄 Description A very simple change to use wss in case that the connection is done through https so /html page will show an image. If this is not in place and you put the endpoint behind a reverse proxy like nginx with ssl cert enable the browser will complain about security risks and you will see this messages on the logs. ``` sh[151588]: 2025/09/14 15:31:45 socket: accept: failed to accept WebSocket connection: WebSocket protocol violation: handshake request must be at least HTTP/1.1: "HTTP/1.0" ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 04:09:07 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cam2ip#61
No description provided.